import { CheckIcon, ChevronLeftIcon, ChevronRightIcon, ClipboardIcon, CopyIcon, CpuIcon, FileCode2Icon, LocateFixedIcon, ReplaceAllIcon, ScissorsIcon, Trash2Icon, } from 'lucide-react'; import { useState } from 'react'; import { MACHINES } from '../data.ts'; import type { MachineHoop, MachinePreset } from '../data.ts'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from '@/components/ui/dropdown-menu.tsx'; import { cn } from '@/utils.ts'; const MACHINE_CLASSES = ['home', 'multi-needle', 'commercial'] as const; export interface ActiveMachine { id: string; hoopId: string; budgetMode: boolean; } export interface EditorContextActions { cut: () => void; copy: () => void; paste: () => void; goToDefinition: () => void; changeAll: () => void; formatDocument: () => void; } interface Actions { active: ActiveMachine | null; budgetMode: boolean; onApply: (machine: MachinePreset, hoop: MachineHoop) => void; onFabric: (fabric: string) => void; onBudgetModeChange: (enabled: boolean) => void; onRemove: () => void; } function MachineItems({ active, budgetMode, onApply, onFabric, onBudgetModeChange, onRemove, }: Actions) { return ( <> {MACHINE_CLASSES.map((cls) => { const machines = MACHINES.filter((machine) => machine.cls === cls); if (!machines.length) return null; return (