import { Autocomplete, TextField } from "@mui/material"; function AutoCompleteSearch({ data, inputValue, placeholder, handleSearch, setInputValue, setSelectedOption, }) { return ( option.name} inputValue={inputValue} className="!w-full" onInputChange={(event, newInputValue) => { setInputValue && setInputValue(newInputValue); handleSearch(newInputValue); }} onChange={(event, newValue) => { setSelectedOption && setSelectedOption(newValue); handleSearch(newValue ? newValue.name : ""); }} renderOption={(props, option) => (
  • {" "} {option.name}
  • )} sx={{ "& .MuiAutocomplete-input": { background: "#ffffff !important", }, }} renderInput={(params) => ( )} /> ); } export default AutoCompleteSearch;