import { Cpu, FileText, Gauge, Ruler, Sparkles, Waypoints } from 'lucide-react' import type { LibraryPart, ProjectSpec } from '../types/pcb' import { EXAMPLE_SPEC } from '../lib/spec' import { NumberField, Section } from './ui' interface Props { name: string spec: ProjectSpec library: LibraryPart[] disabled: boolean imported?: boolean onName: (name: string) => void onChange: (spec: ProjectSpec) => void } export function ProjectInput({ name, spec, library, disabled, imported = false, onName, onChange }: Props) { const set = (patch: Partial) => onChange({ ...spec, ...patch }) const rules = (patch: Partial) => set({ rules: { ...spec.rules, ...patch } }) const opt = (patch: Partial) => set({ optimization: { ...spec.optimization, ...patch } }) const board = (patch: Partial) => set({ board: { ...spec.board, ...patch } }) const selectable = library.filter((p) => p.category !== 'passive') return (
}>
{!imported && (<>
} right={ { e.stopPropagation(); if (!disabled) set({ description: EXAMPLE_SPEC }) }} onKeyDown={(e) => { if (e.key === 'Enter' && !disabled) set({ description: EXAMPLE_SPEC }) }}> use example }>