'use client'; import { motion } from 'framer-motion'; import { cn } from '@/lib/utils'; import type { DecisionNodeState } from '@/lib/visualizations/types'; interface DecisionNodeProps { node: DecisionNodeState; x: number; y: number; width?: number; height?: number; isInPath?: boolean; className?: string; } const STATE_CLASSES = { normal: 'fill-[var(--surface-variant)] stroke-[var(--border)]', exploring: 'fill-[var(--info)]/20 stroke-[var(--info)]', complete: 'fill-[var(--success)]/20 stroke-[var(--success)]', backtracking: 'fill-[var(--warning)]/20 stroke-[var(--warning)]', current: 'fill-[var(--primary)]/20 stroke-[var(--primary)]', } as const; const TEXT_CLASSES = { normal: 'fill-[var(--foreground)]', exploring: 'fill-[var(--info)]', complete: 'fill-[var(--success)]', backtracking: 'fill-[var(--warning)]', current: 'fill-[var(--primary)]', } as const; export function DecisionNode({ node, x, y, width = 64, height = 32, isInPath = false, className, }: DecisionNodeProps) { const isActive = node.state === 'current' || node.state === 'exploring'; const showDecision = node.decision && node.state === 'current'; return ( {/* Decision label above node */} {showDecision && ( {node.decision} )} {/* Node rectangle (rounded) */} {/* Value text */} {node.value} ); }