import { UISref } from '@uirouter/react'; import React from 'react'; import { SearchResult } from '../infrastructure/SearchResult'; import type { ISearchResultSet } from '../infrastructure/infrastructureSearch.service'; import type { ISearchResult } from '../search.service'; import { findMatchingApplicationResultToQuery, getSearchQuery } from './utils'; export interface IGlobalSearchResultsProps { categories: ISearchResultSet[]; query: string; onItemKeyDown: React.EventHandler>; onResultClick: (result: ISearchResult) => any; onSeeMoreClick: () => any; resultRef: (categoryIndex: number, resultIndex: number, ref: HTMLAnchorElement) => any; } export const GlobalSearchResults = ({ categories, query, onItemKeyDown, onResultClick, onSeeMoreClick, resultRef, }: IGlobalSearchResultsProps) => { if (!categories.length) { return ( ); } const matchingApp = findMatchingApplicationResultToQuery(categories, query); return ( ); };