'use client'; import React from 'react'; import { motion } from 'framer-motion'; import type { WorkflowStep, WorkflowNodeType, } from './WorkflowTypes'; interface Props { step: WorkflowStep; index: number; updateStep: ( id: string, field: 'label' | 'type', value: string ) => void; removeStep: (id: string) => void; } const NODE_OPTIONS: { value: WorkflowNodeType; label: string; icon: string; }[] = [ { value: 'task', label: 'Task', icon: '□' }, { value: 'decision', label: 'Decision', icon: '◇' }, { value: 'approval', label: 'Approval', icon: '✓' }, { value: 'api', label: 'API', icon: '⚡' }, { value: 'queue', label: 'Queue', icon: '⇄' }, { value: 'llm', label: 'LLM', icon: '🤖' }, { value: 'human_review', label: 'Human Review', icon: '🧑', }, { value: 'notification', label: 'Notification', icon: '📩', }, ]; function getAccent(type: WorkflowNodeType) { switch (type) { case 'decision': return '#F59E0B'; case 'approval': return '#22C55E'; case 'api': return '#3B82F6'; case 'queue': return '#8B5CF6'; case 'llm': return '#EC4899'; case 'human_review': return '#F97316'; case 'notification': return '#06B6D4'; default: return '#00D4FF'; } } export default function WorkflowNode({ step, index, updateStep, removeStep, }: Props) { const accent = getAccent(step.type); const isDecision = step.type === 'decision'; return (
{/* Node Shape */}
{isDecision ? '?' : String(index + 1).padStart( 2, '0' )}
{/* Main Card */}
{/* Type */} {/* Input */} updateStep( step.id, 'label', e.target.value ) } placeholder="Describe workflow step..." style={{ flex: 1, border: 'none', background: 'transparent', color: '#F0F0FF', fontSize: '16px', outline: 'none', }} /> {/* Remove */}
); }