'use client'; import { motion } from 'framer-motion'; import { cn } from '@/lib/utils'; import type { HeapNodeState } from '@/lib/visualizations/types'; interface HeapNodeProps { node: HeapNodeState; x: number; y: number; radius?: number; className?: string; } const STATE_CLASSES = { normal: 'fill-[var(--surface-variant)] stroke-[var(--border)]', comparing: 'fill-[var(--info)]/20 stroke-[var(--info)]', swapping: 'fill-[var(--warning)]/20 stroke-[var(--warning)]', settled: 'fill-[var(--success)]/20 stroke-[var(--success)]', highlighted: 'fill-[var(--primary)]/30 stroke-[var(--primary)]', removing: 'fill-[var(--destructive)]/20 stroke-[var(--destructive)] opacity-50', } as const; const TEXT_CLASSES = { normal: 'fill-[var(--foreground)]', comparing: 'fill-[var(--info)]', swapping: 'fill-[var(--warning)]', settled: 'fill-[var(--success)]', highlighted: 'fill-[var(--primary)]', removing: 'fill-[var(--destructive)] opacity-50', } as const; export function HeapNode({ node, x, y, radius = 24, className, }: HeapNodeProps) { const isActive = node.state === 'comparing' || node.state === 'swapping' || node.state === 'highlighted'; const isRemoving = node.state === 'removing'; return ( {node.value} ); }