import { memo } from "react"; import { Handle, Position } from "@xyflow/react"; import type { Node, NodeProps } from "@xyflow/react"; import { useDashboardStore } from "../store"; export interface FlowNodeData extends Record { label: string; summary: string; entryPoint?: string; entryType?: string; stepCount: number; flowId: string; } export type FlowFlowNode = Node; function FlowNode({ data }: NodeProps) { const selectNode = useDashboardStore((s) => s.selectNode); const selectedNodeId = useDashboardStore((s) => s.selectedNodeId); const isSelected = selectedNodeId === data.flowId; return (
selectNode(data.flowId)} > {data.entryPoint && (
{data.entryPoint}
)}
{data.label}
{data.summary}
{data.stepCount} step{data.stepCount !== 1 ? "s" : ""}
); } export default memo(FlowNode);