import { FC } from 'react'; import { getBezierPath, ConnectionLineComponentProps, Node, } from '@react-flow/core'; import { getEdgeParams } from './utils'; const FloatingConnectionLine: FC = ({ targetX, targetY, sourcePosition, targetPosition, sourceNode, }) => { if (!sourceNode) { return null; } const targetNode = { id: 'connection-target', width: 1, height: 1, position: { x: targetX, y: targetY }, } as Node; const { sx, sy } = getEdgeParams(sourceNode, targetNode); const d = getBezierPath({ sourceX: sx, sourceY: sy, sourcePosition, targetPosition, targetX, targetY, }); return ( ); }; export default FloatingConnectionLine;