import { h } from 'preact'; import { useState, useMemo } from 'preact/hooks'; // A dropdown with an inline search box. Extracted from SyntheticWizard so the // same searchable picker can be reused (e.g. the logic editor's signal field). export default function SearchableSelect({ value, options, onSelect, placeholder = 'Select…', }: { value: string; options: string[]; onSelect: (val: string) => void; placeholder?: string; }) { const [open, setOpen] = useState(false); const [filter, setFilter] = useState(''); const filtered = useMemo(() => { const f = filter.toLowerCase(); return options.filter(o => o.toLowerCase().includes(f)); }, [options, filter]); return (