MCPcopy
hub / github.com/cursor/community-plugins / SearchInput

Function SearchInput

apps/cursor/src/components/search-input.tsx:7–35  ·  view source on GitHub ↗
({
  placeholder,
  className,
  shallow = true,
}: {
  placeholder: string;
  className?: string;
  shallow?: boolean;
})

Source from the content-addressed store, hash-verified

5import { SearchField } from "./ui/search-field";
6
7export function SearchInput({
8 placeholder,
9 className,
10 shallow = true,
11}: {
12 placeholder: string;
13 className?: string;
14 shallow?: boolean;
15}) {
16 const [search, setSearch] = useQueryState("q", {
17 defaultValue: "",
18 shallow,
19 });
20
21 const handleClear = () => setSearch("");
22
23 return (
24 <SearchField
25 placeholder={placeholder}
26 value={search}
27 onChange={setSearch}
28 onClear={handleClear}
29 onKeyDown={(e) => {
30 if (e.key === "Escape") handleClear();
31 }}
32 className={cn("w-full", className)}
33 />
34 );
35}

Callers

nothing calls this directly

Calls 2

cnFunction · 0.90
handleClearFunction · 0.85

Tested by

no test coverage detected