import equal from "fast-deep-equal"; import { ComponentProps } from "react"; import { useTranslation } from "renderer/hooks/use-translation.hook"; type Props = Omit, "onChange"> & { options?: BsmSelectOption[]; selected?: T; onChange?: (value: T) => void; }; export function BsmSelect(props: Props) { const t = useTranslation(); const handleChange: ComponentProps<"select">["onChange"] = e => { e.preventDefault(); props.onChange?.(props.options?.[parseInt(e.target.value)]?.value); }; return ( ); } export interface BsmSelectOption { text: string; value: T; }