"use client"; import { memo } from "react"; import { EdgeProps, BaseEdge, EdgeLabelRenderer, getSmoothStepPath, } from "@xyflow/react"; export const ConditionalEdge = memo(function ConditionalEdge({ id, sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, data, markerEnd, }: EdgeProps) { const [edgePath, labelX, labelY] = getSmoothStepPath({ sourceX, sourceY, sourcePosition, targetX, targetY, targetPosition, }); const condition = data?.condition as string | undefined; return ( <> {condition && (
{condition}
)} ); });