import SearchD from "@/components/icons/SearchD"; import { Autocomplete, TextField, Button, ButtonGroup } from "@mui/material"; import { useState } from "react"; function SmSearch({ placeholder, handleSearch, data }) { const [inputValue, setInputValue] = useState(""); const [selectedOption, setSelectedOption] = useState(null); return ( option.name} inputValue={inputValue} className="!w-full" onInputChange={(event, newInputValue) => { setInputValue(newInputValue); handleSearch(newInputValue); }} onChange={(event, newValue) => { setSelectedOption(newValue); handleSearch(newValue ? newValue.name : ""); }} renderInput={(params) => ( )} /> ); } export default SmSearch;