'use client'; import React from 'react'; import { motion } from 'framer-motion'; export type FlowchartNodeType = | 'input' | 'task' | 'decision' | 'automation' | 'approval' | 'output' | 'api' | 'queue' | 'llm' | 'human_review' | 'notification'; interface FlowchartNodeProps { title: string; type: FlowchartNodeType; subtitle?: string; isLast?: boolean; } function getNodeAccent( type: FlowchartNodeType ) { switch (type) { case 'input': return '#06B6D4'; case 'automation': return '#F97316'; case 'output': return '#22C55E'; case 'decision': return '#F59E0B'; case 'api': return '#3B82F6'; case 'queue': return '#8B5CF6'; case 'llm': return '#EC4899'; case 'approval': return '#22C55E'; case 'human_review': return '#F97316'; case 'notification': return '#06B6D4'; default: return '#00D4FF'; } } function getNodeIcon( type: FlowchartNodeType ) { switch (type) { case 'input': return '□'; case 'automation': return '⚡'; case 'output': return '✓'; case 'decision': return '?'; case 'api': return '⚡'; case 'queue': return '⇄'; case 'llm': return '🤖'; case 'approval': return '✓'; case 'human_review': return '🧑'; case 'notification': return '📩'; default: return '□'; } } export default function FlowchartNode({ title, type, subtitle, isLast = false, }: FlowchartNodeProps) { const accent = getNodeAccent(type); const icon = getNodeIcon(type); const isDecision = type === 'decision'; return ( {/* NODE */}
{/* ICON ONLY */}
{icon}
{/* TITLE ONLY */}
{title}
{/* Optional subtitle */} {subtitle && (
{subtitle}
)}
{/* CONNECTOR LINE */} {!isLast && (
)} ); }