// material-ui import { Button, Autocomplete, Grid, TextField, Typography } from '@mui/material'; import MainCard from "../../../components/MainCard"; import {useForm} from "react-hook-form"; import { useState} from "react"; import {PNSPS_BUTTON_THEME} from "../../../themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const UserSearchForm_Organization = ({applySearch}) => { const [type, setType] = useState([]); const [accountFilter, setAccountFilter] = useState("All"); const { reset, register, handleSubmit } = useForm() const onSubmit = (data) => { let typeArray = []; for(let i =0; i < type.length; i++){ typeArray.push(type[i].label); } const temp = { username: data.userName, fullenName: data.fullenName, email: data.email, phone: data.phone, brNoStr: data.brNoStr, orgName: data.orgName, accountFilter: accountFilter=="All"?null:accountFilter, }; applySearch(temp); }; function resetForm(){ setType([]); setAccountFilter("All"); reset(); } return (
{/*row 1*/} Search {/*row 2*/} { if (newValue !== null){ setAccountFilter(newValue); }else{ setAccountFilter("All"); } }} renderInput={(params) => ( )} /> {/**/} {/* */} {/**/} {/*last row*/}
); }; export default UserSearchForm_Organization;