53 lines
1.7 KiB
JavaScript
53 lines
1.7 KiB
JavaScript
import BottomSelect from "@/components/icons/BottomSelect";
|
|
import { Autocomplete, TextField } from "@mui/material";
|
|
import { styleTextSelectRight } from "@/mui";
|
|
|
|
function AutoCompleteSelect({ list, updateData, name, label }) {
|
|
return (
|
|
<Autocomplete
|
|
disablePortal
|
|
options={list}
|
|
className="!w-full !rounded-lg md:!w-[344px]"
|
|
onChange={(event) =>
|
|
updateData &&
|
|
updateData(event, name)
|
|
}
|
|
sx={{
|
|
...styleTextSelectRight,
|
|
// Hide Icon Number
|
|
'& input::-webkit-outer-spin-button, & input::-webkit-inner-spin-button': {
|
|
display: 'none'
|
|
},
|
|
'& input[type=number]': {
|
|
MozAppearance: 'textfield'
|
|
},
|
|
'& .MuiInputBase-root': {
|
|
borderRadius: 2,
|
|
padding: '5px 16px !important'
|
|
},
|
|
}}
|
|
renderInput={params =>
|
|
<TextField
|
|
fullWidth
|
|
{...params}
|
|
InputProps={{
|
|
...params.InputProps,
|
|
endAdornment: (
|
|
<div
|
|
className="absolute left-4"
|
|
>
|
|
<BottomSelect />
|
|
</div>
|
|
)
|
|
}}
|
|
placeholder={label}
|
|
sx={{
|
|
borderRadius: '8px'
|
|
}}
|
|
/>
|
|
}
|
|
/>
|
|
)
|
|
}
|
|
|
|
export default AutoCompleteSelect |