import { memo, useState } from 'react'; import { Handle, Position } from '@xyflow/react'; import { Bell, Box, Cloud, Code, Cpu, Database, GitBranch, Globe, Layers, Lock, Play } from 'lucide-react'; const ICONS = { Bell, Box, Cloud, Code, Cpu, Database, GitBranch, Globe, Layers, Lock, Play }; function WorkflowNode({ data, selected }) { const [editing, setEditing] = useState(false); const [label, setLabel] = useState(data.label); const isDecision = data.nodeType === 'decision'; const Icon = ICONS[data.iconName] || Cpu; return (
{isDecision ? (
{label}
) : ( <>
{data.nodeType}
{editing ? ( setLabel(event.target.value)} onBlur={() => { setEditing(false); data.label = label; }} autoFocus className="w-full border-b border-white/20 bg-transparent text-xs text-white outline-none" /> ) : (

setEditing(true)} className="path-text cursor-text text-xs font-semibold leading-snug text-white"> {label}

)} {data.description &&

{data.description}

} )}
); } export default memo(WorkflowNode);