import { Selector, SelectorOption, SelectorProps } from "@/components"; import { useMemo } from "react"; interface Props { options: readonly Language.Info[]; } type RemovedSelectorProps = Omit< SelectorProps, "label" >; export type LanguageSelectorProps = Override< Props, RemovedSelectorProps >; function getLabel(lang: Language.Info) { return lang.name; } export function LanguageSelector( props: LanguageSelectorProps ) { const { options, ...selector } = props; const items = useMemo[]>( () => options.map((v) => ({ label: v.name, value: v, })), [options] ); return ( ); }