import { useNodes, BezierEdge } from "@xyflow/react"; import { getSmartEdge } from "../getSmartEdge"; import type { EdgeProps } from "@xyflow/react"; const size = 20; export function SmartEdgeCustomLabel(props: EdgeProps) { const { id: edgeId, sourcePosition, targetPosition, sourceX, sourceY, targetX, targetY, style, markerStart, markerEnd, } = props; const nodes = useNodes(); const getSmartEdgeResponse = getSmartEdge({ sourcePosition, targetPosition, sourceX, sourceY, targetX, targetY, nodes, }); if (getSmartEdgeResponse instanceof Error) { return ; } const { edgeCenterX, edgeCenterY, svgPathString } = getSmartEdgeResponse; return ( <> { alert(`Clicked on edge with id ${edgeId}`); }} type="button" > x > ); }