import { useState } from "react"; import { Select as MuiSelect, MenuItem, FormControl, useTheme, } from "@mui/material"; import ArrowDown from "@icons/ArrowDownIcon"; import type { SelectChangeEvent, SxProps } from "@mui/material"; type SelectProps = { items: string[]; empty?: boolean; onChange?: (num: number) => void; sx?: SxProps; }; export const Select = ({ items, empty, onChange, sx }: SelectProps) => { const [activeItem, setActiveItem] = useState(empty ? -1 : 0); const theme = useTheme(); const handleChange = (event: SelectChangeEvent) => { setActiveItem(Number(event.target.value)); onChange?.(Number(event.target.value)); }; return ( } > {items.map((item, index) => ( {item} ))} ); };