import React from 'react'; // material-ui import { useTheme } from '@mui/material/styles'; import { Divider, FormControl, InputAdornment, MenuItem, TextField } from '@mui/material'; // project imports import { GenericCardProps } from 'types'; // ==============================|| FORM CONTROL SELECT ||============================== // export interface FormControlSelectProps { captionLabel?: string; currencies?: { value: string; label: string }[]; formState?: string; iconPrimary?: GenericCardProps['iconPrimary']; iconSecondary?: GenericCardProps['iconPrimary']; selected?: string; textPrimary?: string; textSecondary?: string; } const FormControlSelect = ({ captionLabel, currencies, formState, iconPrimary, iconSecondary, selected, textPrimary, textSecondary }: FormControlSelectProps) => { const theme = useTheme(); const IconPrimary = iconPrimary!; const primaryIcon = iconPrimary ? : null; const IconSecondary = iconSecondary!; const secondaryIcon = iconSecondary ? : null; const errorState = formState === 'error'; const val = selected || ''; const [currency, setCurrency] = React.useState(val); const handleChange = (event: React.ChangeEvent | undefined) => { event?.target.value && setCurrency(event?.target.value); }; return ( {primaryIcon && {primaryIcon}} {textPrimary && ( <> {textPrimary} )} ), endAdornment: ( <> {secondaryIcon && {secondaryIcon}} {textSecondary && ( <> {textSecondary} )} ) }} > {currencies?.map((option, index) => ( {option.label} ))} ); }; export default FormControlSelect;