import { Globe, Headset, Link2, LucideIcon, OctagonX, Play, Webhook, X } from 'lucide-react'; import { useEffect } from 'react'; import { Button } from '@/components/ui/button'; import { NodeType } from './types'; type NodeTypeConfig = { type: NodeType; label: string; description: string; icon: LucideIcon; }; type AddNodePanelProps = { isOpen: boolean; onClose: () => void; onNodeSelect: (nodeType: NodeType) => void; }; const NODE_TYPES: NodeTypeConfig[] = [ { type: NodeType.START_CALL, label: 'Start Call', description: 'Create a start call node', icon: Play }, { type: NodeType.AGENT_NODE, label: 'Agent Node', description: 'Create an agent node', icon: Headset }, { type: NodeType.END_CALL, label: 'End Call', description: 'Create an end call node', icon: OctagonX } ]; const GLOBAL_NODE_TYPES: NodeTypeConfig[] = [ { type: NodeType.GLOBAL_NODE, label: 'Global Node', description: 'Create a global node', icon: Globe } ]; const TRIGGER_NODE_TYPES: NodeTypeConfig[] = [ { type: NodeType.TRIGGER, label: 'API Trigger', description: 'Enable API-based call triggering', icon: Webhook } ]; const WEBHOOK_NODE_TYPES: NodeTypeConfig[] = [ { type: NodeType.WEBHOOK, label: 'Webhook', description: 'Send HTTP request after workflow completion', icon: Link2 } ]; function NodeSection({ title, nodes, onNodeSelect }: { title: string; nodes: NodeTypeConfig[]; onNodeSelect: (nodeType: NodeType) => void; }) { return (

{title}

{nodes.map((node) => ( ))}
); } export default function AddNodePanel({ isOpen, onNodeSelect, onClose }: AddNodePanelProps) { useEffect(() => { const handleKeyDown = (event: KeyboardEvent) => { if (event.key === 'Escape' && isOpen) { onClose(); } }; document.addEventListener('keydown', handleKeyDown); return () => document.removeEventListener('keydown', handleKeyDown); }, [isOpen, onClose]); return (

Add New Node

); }