import PropTypes from 'prop-types';
import { useState } from 'react';
// material-ui
import Divider from '@mui/material/Divider';
import FormControl from '@mui/material/FormControl';
import InputAdornment from '@mui/material/InputAdornment';
import MenuItem from '@mui/material/MenuItem';
import TextField from '@mui/material/TextField';
export default function FormControlSelect({
captionLabel,
currencies,
formState,
iconPrimary,
iconSecondary,
selected,
textPrimary,
textSecondary
}) {
const IconPrimary = iconPrimary;
const primaryIcon = iconPrimary ? : null;
const IconSecondary = iconSecondary;
const secondaryIcon = iconSecondary ? : null;
const errorState = formState === 'error';
const val = selected || '';
const [currency, setCurrency] = useState(val);
const handleChange = (event) => {
event?.target.value && setCurrency(event?.target.value);
};
return (
{primaryIcon && {primaryIcon}}
{textPrimary && (
<>
{textPrimary}
>
)}
>
),
endAdornment: (
<>
{secondaryIcon && {secondaryIcon}}
{textSecondary && (
<>
{textSecondary}
>
)}
>
)
}
}}
>
{currencies?.map((option, index) => (
))}
);
}
FormControlSelect.propTypes = {
captionLabel: PropTypes.string,
currencies: PropTypes.object,
formState: PropTypes.string,
iconPrimary: PropTypes.any,
iconSecondary: PropTypes.any,
selected: PropTypes.string,
textPrimary: PropTypes.string,
textSecondary: PropTypes.string
};