import React from 'react' import { useNodes, BezierEdge } from 'reactflow' import { SmartEdge } from '../SmartEdge' import { svgDrawSmoothLinePath, pathfindingAStarDiagonal } from '../functions' import type { SmartEdgeOptions } from '../SmartEdge' import type { EdgeProps } from 'reactflow' const BezierConfiguration: SmartEdgeOptions = { drawEdge: svgDrawSmoothLinePath, generatePath: pathfindingAStarDiagonal, fallback: BezierEdge } export function SmartBezierEdge( props: EdgeProps ) { const nodes = useNodes() return ( {...props} options={BezierConfiguration} nodes={nodes} /> ) }