import { get } from 'lodash'; import React from 'react'; import { ProjectSummaryPod } from './ProjectSummaryPod'; import { SearchResultPod } from './SearchResultPod'; import type { IRecentHistoryEntry } from '../../history'; import type { SearchResultType } from '../searchResult/searchResultType'; export type ISearchResult = IRecentHistoryEntry & { displayName: string; account?: string }; export interface ISearchResultPodData { category: string; config: SearchResultType; results: ISearchResult[]; } export interface ISearchResultPodsProps { results: ISearchResultPodData[]; onRemoveProject?: (projectId: string) => void; onRemoveItem?: (categoryName: string, itemId: string) => void; onResultClick: (categoryName: string) => void; } export class SearchResultPods extends React.Component { public render() { const { results } = this.props; if (!results.length) { return null; } const projects: ISearchResultPodData = results.find((x) => x.category === 'projects'); const otherCategories: ISearchResultPodData[] = results .filter((x) => x.category !== 'projects') .sort((a, b) => a.category.localeCompare(b.category)); return (

Recently viewed

{projects && (
{projects.results.map((project) => ( ))}
)}
{otherCategories.map((category) => ( this.props.onResultClick(category.category)} /> ))}
); } }