MCPcopy Create free account
hub / github.com/CommandCodeAI/BaseAI / SearchResults

Function SearchResults

apps/baseai.dev/src/components/Search.tsx:233–271  ·  view source on GitHub ↗
({
	autocomplete,
	query,
	collection
}: {
	autocomplete: Autocomplete;
	query: string;
	collection: AutocompleteCollection<Result>;
})

Source from the content-addressed store, hash-verified

231}
232
233function SearchResults({
234 autocomplete,
235 query,
236 collection
237}: {
238 autocomplete: Autocomplete;
239 query: string;
240 collection: AutocompleteCollection<Result>;
241}) {
242 if (collection.items.length === 0) {
243 return (
244 <div className="p-6 text-center">
245 <NoResultsIcon className="mx-auto h-5 w-5 stroke-zinc-900 dark:stroke-zinc-600" />
246 <p className="mt-2 text-xs text-zinc-700 dark:text-zinc-400">
247 Nothing found for{' '}
248 <strong className="break-words font-semibold text-zinc-900 dark:text-white">
249 &lsquo;{query}&rsquo;
250 </strong>
251 . Please try again.
252 </p>
253 </div>
254 );
255 }
256
257 return (
258 <ul {...autocomplete.getListProps()}>
259 {collection.items.map((result, resultIndex) => (
260 <SearchResult
261 key={result.url}
262 result={result}
263 resultIndex={resultIndex}
264 autocomplete={autocomplete}
265 collection={collection}
266 query={query}
267 />
268 ))}
269 </ul>
270 );
271}
272
273const SearchInput = forwardRef<
274 React.ElementRef<'input'>,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected