import { useState } from "react"; import { BiSlider } from "react-icons/bi"; import { useSearchContext } from "../../contexts/SearchContext"; import { VuiButtonPrimary, VuiButtonSecondary, VuiButtonTertiary, VuiDrawer, VuiFlexContainer, VuiFlexItem, VuiHorizontalRule, VuiIcon, VuiLabel, VuiSearchSelect, VuiSpacer, VuiText, VuiTextColor, VuiTitle } from "../../ui"; import { SUMMARY_LANGUAGES, SummaryLanguage, humanizeLanguage } from "../types"; const languageOptions = SUMMARY_LANGUAGES.map((code) => ({ value: code, label: humanizeLanguage(code) })); type Props = { isOpen: boolean; onClose: () => void; }; export const OptionsDrawer = ({ isOpen, onClose }: Props) => { const { language, onSearch } = useSearchContext(); const [isLanguageMenuOpen, seIisLanguageMenuOpen] = useState(false); const [newLanguage, setNewLanguage] = useState(language); return (

Options

} > Summary language

Summaries will be written in this language.

{ setNewLanguage(value[0] as SummaryLanguage); }} selected={[newLanguage]} options={languageOptions} isMultiSelect={false} > {humanizeLanguage(newLanguage)} onClose()}> Cancel { if (newLanguage !== language) { onSearch({ language: newLanguage as SummaryLanguage }); } onClose(); }} > Save
); };