import { Handle, Position, type NodeProps, type Node } from '@xyflow/react'; import { clsx } from 'clsx'; import { CheckCircle2, Circle, Clock } from 'lucide-react'; type NodeData = { label: string; status: 'pending' | 'in_progress' | 'completed'; description?: string; links?: { title: string; url: string }[]; }; // We need to extend NodeProps to include our specific data type export function CustomNode({ data }: NodeProps>) { const statusColors = { pending: 'bg-gray-100 border-gray-300 text-gray-500', in_progress: 'bg-blue-50 border-blue-400 text-blue-700', completed: 'bg-green-50 border-green-400 text-green-700', }; const status = (data.status as keyof typeof statusColors) || 'pending'; const StatusIcon = { pending: Circle, in_progress: Clock, completed: CheckCircle2, }[status]; return (
{data.label}
); }