import { BiTimeFive } from "react-icons/bi"; import { useSearchContext } from "../../contexts/SearchContext"; import { VuiButtonSecondary, VuiDrawer, VuiFlexContainer, VuiFlexItem, VuiIcon, VuiMenu, VuiMenuItem, VuiText, VuiTextColor, VuiTitle } from "../../ui"; import { humanizeLanguage } from "../types"; type Props = { isOpen: boolean; onClose: () => void; }; export const HistoryDrawer = ({ isOpen, onClose }: Props) => { const { onSearch, history, clearHistory } = useSearchContext(); return (

History

Clear } > {!history.length ? (

No history to show.

) : ( {history.map(({ query, filter, language, date }) => { let subTitle = date; if (language) { subTitle += ` • ${humanizeLanguage(language)}`; } return ( { onSearch({ value: query, filter, language }); onClose(); }} /> ); })} )}
); };