import React from 'react'; import { getBezierPath, BaseEdge, useInternalNode } from '@xyflow/react'; import { floatingPoints } from './floatingEdge'; export default function StickerEdge({ id, source, target, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style = {}, selected, interactionWidth, }) { const sourceNode = useInternalNode(source); const targetNode = useInternalNode(target); // Threads float between the facing sides of the sticker and its card const p = sourceNode && targetNode ? floatingPoints(sourceNode, targetNode, {}) : { sx: sourceX, sy: sourceY, tx: targetX, ty: targetY, sourcePos: sourcePosition, targetPos: targetPosition }; const [edgePath] = getBezierPath({ sourceX: p.sx, sourceY: p.sy, sourcePosition: p.sourcePos, targetX: p.tx, targetY: p.ty, targetPosition: p.targetPos, curvature: 0.6, // More curved for a "hanging thread" feel }); return ( <> {/* Interaction area for easier clicking */} {/* Shadow path */} {/* Main Thread */} {/* Optional: Small highlight on the thread */} ); }