'use client'; import { useState } from 'react'; type Option = { id: string; label: string; sub?: string }; /** Type to filter, tap to choose. A native { setQuery(''); setOpen(true); }} onChange={e => { setQuery(e.target.value); setOpen(true); if (value) onChange(''); }} onBlur={() => setTimeout(() => setOpen(false), 150)} onKeyDown={e => { if (e.key === 'Enter') { e.preventDefault(); if (matches[0]) { onChange(matches[0].id); setOpen(false); } } if (e.key === 'Escape') setOpen(false); }}/> {open && } ; }