import { useMemo, useState } from 'react' import { allManufacturers } from '../../domain/diagram' import { useCatalogStore } from '../../state/catalogStore' const NEW_MANUFACTURER_VALUE = '__new__' const NONE_VALUE = '' /** A manufacturer setDraftName(e.target.value)} onKeyDown={(e) => { if (e.key === 'Enter') { e.preventDefault() commitNewManufacturer() } else if (e.key === 'Escape') { setCreating(false) setDraftName('') } }} placeholder="New manufacturer name" className="w-full min-w-0 flex-1 rounded border border-slate-300 px-2 py-1 text-sm" /> ) } return ( ) }