+
+
+ {
+ setQuery(e.target.value);
+ setOpen(true);
+ }}
+ onFocus={() => setOpen(true)}
+ onKeyDown={onKeyDown}
+ placeholder="Search…"
+ className="w-full h-8 pl-8 pr-2 text-sm rounded-md bg-sidebar-accent/40 text-sidebar-foreground placeholder:text-sidebar-foreground/50 border border-sidebar-border focus:outline-none focus:ring-1 focus:ring-sidebar-primary"
+ />
+ {loading && (
+
+ )}
+
+
+ {open && query.trim().length >= 2 && (
+
+ {results.length === 0 && !loading ? (
+
+ No results
+
+ ) : (
+
+ {results.map((r, idx) => {
+ const Icon = KIND_ICON[r.kind];
+ return (
+ -
+
+
+ );
+ })}
+
+ )}
+
+ )}
+
+ );
+}