import { useDraggable } from '@dnd-kit/core'; import type { ModuleType } from '../../types'; import { MODULE_TYPE_LABELS, MODULE_TYPE_COLORS, MODULE_U_DEFAULTS, MODULE_PORT_DEFAULTS, } from '../../lib/constants'; import { cn } from '../../lib/utils'; const ALL_TYPES: ModuleType[] = [ 'SWITCH', 'AGGREGATE_SWITCH', 'ROUTER', 'FIREWALL', 'PATCH_PANEL', 'MODEM', 'SERVER', 'NAS', 'PDU', 'AP', 'BLANK', 'OTHER', ]; function PaletteItem({ type }: { type: ModuleType }) { const { attributes, listeners, setNodeRef, isDragging } = useDraggable({ id: `palette-${type}`, data: { type }, }); const colors = MODULE_TYPE_COLORS[type]; return (