diff --git a/packages/cli/src/components/SearchBox.tsx b/packages/cli/src/components/SearchBox.tsx index 5b80749..194d210 100644 --- a/packages/cli/src/components/SearchBox.tsx +++ b/packages/cli/src/components/SearchBox.tsx @@ -11,12 +11,14 @@ export function SearchBox({ initialQuery, onKeyDown, onChange, + onSubmit, }: { components: T[] helper: string initialQuery?: string onKeyDown?: (i: string, k: Key, app: ReturnType) => void onChange?: (item: T) => void + onSubmit?: (value: string) => void }) { const [query, setQuery] = useState(initialQuery ?? '') const [isLoading, setLoading] = useState(false) @@ -57,23 +59,23 @@ export function SearchBox({ }) return ( - + {helper} - - - ? + + + Search? - setQuery(v)} /> + setQuery(v)} showCursor placeholder={'query'} onSubmit={onSubmit} /> {isLoading ? ( ) : ( - + {suggestions.map((name, index) => { return ( - - + + {components[components.findIndex(({key}) => key === name)].displayName}