// material-uisubDivision import { Button, CardContent, FormControlLabel, Grid, TextField, Typography } from '@mui/material'; import MainCard from "../../components/MainCard"; import {useForm} from "react-hook-form"; import { // useEffect, useState} from "react"; import Checkbox from "@mui/material/Checkbox"; import * as React from "react"; import AddCircleOutlineIcon from '@mui/icons-material/AddCircleOutline'; import {useNavigate} from "react-router"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const UserSearchForm = ({applySearch}) => { const navigate = useNavigate(); const [type, setType] = useState([]); const [locked, setLocked] = useState(false); 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, post: data.post, email: data.email, phone: data.phone, locked: locked, }; applySearch(temp); }; function resetForm(){ setType([]); setLocked(false); reset(); } const handleNewUserClick = (id) => { // console.log(id) navigate('/user/'+ id); }; return (
{/*row 1*/} Search Form (GLD User) {/*row 2*/} setLocked(event.target.checked)} name="checked" color="primary" size="small" /> } label={Locked} /> {/*last row*/}
); }; export default UserSearchForm;