(item?: string)
| 110 | }, [searchResults, isPending, suggestionType, purify]); |
| 111 | |
| 112 | const submitQuery = async (item?: string) => { |
| 113 | const itemQuery = item?.replace?.(sanitizeSearchTitleMatch, ''); |
| 114 | await onSubmitQuery(itemQuery || typedQuery.current || '', { |
| 115 | filters: { |
| 116 | time: time.toString(), |
| 117 | contentCuration: contentCurationFilter, |
| 118 | postTypes: postTypesFilter, |
| 119 | }, |
| 120 | }); |
| 121 | if (itemQuery) { |
| 122 | initialQuery.current = itemQuery; |
| 123 | typedQuery.current = itemQuery; |
| 124 | } |
| 125 | |
| 126 | setIsFocused(false); |
| 127 | }; |
| 128 | |
| 129 | const { selectedItemIndex, onKeyDown } = useAutoComplete(items, submitQuery); |
| 130 | const [debounceQuery] = useDebounceFn<string>( |
no test coverage detected