import { memo } from "react"; import { Handle, Position, type NodeProps } from "@xyflow/react"; import { Bot, Play, CheckCircle2, XCircle, Clock, Cpu, Wrench, Pencil } from "lucide-react"; import { cn } from "@/lib/utils"; import { useGraphStore } from "@/stores/graphStore"; import type { AgentNodeData } from "@/stores/graphStore"; const statusConfig = { idle: { color: "border-border", icon: null, bg: "bg-card" }, pending: { color: "border-yellow-400", icon: Clock, bg: "bg-yellow-50 dark:bg-yellow-950" }, running: { color: "border-blue-500", icon: Play, bg: "bg-blue-50 dark:bg-blue-950" }, completed: { color: "border-green-500", icon: CheckCircle2, bg: "bg-green-50 dark:bg-green-950" }, error: { color: "border-red-500", icon: XCircle, bg: "bg-red-50 dark:bg-red-950" }, }; function AgentNodeComponent({ data }: NodeProps) { const nodeData = data as unknown as AgentNodeData; const status = statusConfig[nodeData.executionStatus] || statusConfig.idle; const StatusIcon = status.icon; const setEditingNodeId = useGraphStore((s) => s.setEditingNodeId); return (
{nodeData.persona}
)}