import { useState } from 'react'; export const MONTEURE = ['Michael', 'Daniel', 'Dietmar', 'Fidelis']; interface Props { value: string; onChange: (v: string) => void; onCommit?: (v: string) => void; } export default function MonteurField({ value, onChange, onCommit }: Props) { const [customMode, setCustomMode] = useState(() => value !== '' && !MONTEURE.includes(value)); function handleSelect(v: string) { if (v === '__custom__') { setCustomMode(true); return; } setCustomMode(false); onChange(v); onCommit?.(v); } return ( ); }