// material-ui import { Button, Grid, TextField, Autocomplete, Typography } from '@mui/material'; import MainCard from "components/MainCard"; import { useForm } from "react-hook-form"; import * as React from "react"; // import * as DateUtils from "utils/DateUtils"; import {PNSPS_BUTTON_THEME} from "themes/buttonConst"; import {ThemeProvider} from "@emotion/react"; // import * as ComboData from "utils/ComboData"; // ==============================|| DASHBOARD - DEFAULT ||============================== // const SearchGazetteIssueForm = ({ applyExport, comboData, waitDownload}) => { const [selectedYear, setSelectedYear] = React.useState([]); // const [defaultYear, setDefaultYear] = React.useState(searchCriteria.year); const [comboList, setComboList] = React.useState([]); // const [onReady, setOnReady] = React.useState(false); const { // register, handleSubmit } = useForm() const onSubmit = () => { // console.log(selectedYear) if (selectedYear !=null && Object.keys(selectedYear).length>0){ // console.log("okkkkkkkkkkkkkkkk") const temp = { year: selectedYear.label, }; applyExport(temp); } }; React.useEffect(() => { if (comboData && comboData.length > 0) { // console.log(comboData) // const labelValue = comboData.find(obj => obj.label === searchCriteria.year); // console.log(labelValue) // if(selectedYear.length == 0){ // setSelectedYear(comboData[0]) // } setComboList(comboData) // setSelectedYear(searchCriteria.dateFrom) } }, [comboData]); return (
{/*row 1*/} Export Preliminary Gazette Issue From Holiday Year {/*row 2*/} option != null && typeof option === "object" && option.label != null ? String(option.label) : "" } onChange={(event, newValue) => { setSelectedYear(newValue); }} sx={{ '& .MuiInputBase-root': { alignItems: 'center' }, '& .MuiAutocomplete-endAdornment': { top: '50%', transform: 'translateY(-50%)' }, '& .MuiOutlinedInput-root': { height: 40 } }} renderInput={(params) => } />
); }; export default SearchGazetteIssueForm;