import React from 'react' import { useNodes, StraightEdge } from 'reactflow' import { SmartEdge } from '../SmartEdge' import { svgDrawStraightLinePath, pathfindingAStarNoDiagonal } from '../functions' import type { SmartEdgeOptions } from '../SmartEdge' import type { EdgeProps } from 'reactflow' const StraightConfiguration: SmartEdgeOptions = { drawEdge: svgDrawStraightLinePath, generatePath: pathfindingAStarNoDiagonal, fallback: StraightEdge } export function SmartStraightEdge< EdgeDataType = unknown, NodeDataType = unknown >(props: EdgeProps) { const nodes = useNodes() return ( {...props} options={StraightConfiguration} nodes={nodes} /> ) }