+ handleSuccessDialogControl();
+ } catch (error) {
+ console.error(error);
+ }
+ onClose();
+ });
+ // 기관이 등록한 extra 요구 정보들을 불러오기
+ // const [extraData, setextraData] = useState
(null);
+ const [extraData] = useState('담당 교수님 성함, 사용 인원');
+ // useEffect(() => {
+ // // 데이터를 가져오는 함수 정의
+ // const fetchData = async () => {
+ // try {
+ // // API생성되면 department id 받아서 그 id를 가지고 해당 dept/id로 호출해서 정보 받아오기
+ // const response = await axios.get(`${BASE_URL}/dept/deptId/1`);
+ // setextraData(response.data.extraInfo); // 데이터 설정
+ // console.log(response.data.extraInfo);
+ // } catch (error) {
+ // console.log("error");
+ // }
+ // };
+
+ // fetchData(); // 데이터 가져오기 함수 호출
+ // }, []);
+ const [inputFields, setInputFields] = useState([]);
+ const [words, setWords] = useState([]);
+ useEffect(() => {
+ if (extraData) {
+ const word = extraData.split(',');
+ const initialFields = word.map(() => ({ value: '' }));
+ setInputFields(initialFields);
+ setWords(word);
+ }
+ }, [extraData, words]);
+ const startTimeAsDate = new Date(`1970-01-01T${selectedData.startTime}`);
+ const endTimeAsDate = new Date(`1970-01-01T${selectedData.endTime}`);
+ return (
+
-
setIsSuccessDialogOpen(false)} />
-
- );
-}
\ No newline at end of file
+ setIsSuccessDialogOpen(false)}
+ />
+
+ );
+}
diff --git a/src/sections/reserve/reserve-regularly-form1.tsx b/src/sections/reserve/reserve-regularly-form1.tsx
index df842ac..f67ff2e 100644
--- a/src/sections/reserve/reserve-regularly-form1.tsx
+++ b/src/sections/reserve/reserve-regularly-form1.tsx
@@ -3,40 +3,21 @@ import { useCallback, useEffect, useState } from 'react';
import styled from 'styled-components';
// @mui
import Box from '@mui/material/Box';
-import Button from '@mui/material/Button';
import { DesktopTimePicker } from '@mui/x-date-pickers';
import { DemoContainer } from '@mui/x-date-pickers/internals/demo';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import Typography from '@mui/material/Typography';
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
-import FormControl from '@mui/material/FormControl';
-import Select, { SelectChangeEvent } from '@mui/material/Select';
import Fab from '@mui/material/Fab';
import AddIcon from '@mui/icons-material/Add';
import MinusIcon from '@mui/icons-material/Remove';
// hooks
// import { useBoolean } from 'src/hooks/use-boolean';
// components
-import { useSettingsContext } from 'src/components/settings';
import { useForm } from 'react-hook-form';
-import FormProvider, {
- RHFEditor,
- RHFSelect,
- RHFUpload,
- RHFSwitch,
- RHFSlider,
- RHFCheckbox,
- RHFTextField,
- RHFRadioGroup,
- RHFMultiSelect,
- RHFAutocomplete,
- RHFMultiCheckbox,
-} from 'src/components/hook-form';
+import FormProvider from 'src/components/hook-form';
import dayjs, { Dayjs } from 'dayjs';
-// api
-import { GetSpace } from 'src/api/spaceApi';
-import { useQuery } from 'react-query';
import RowRadioButtonsGroup from './reserve-radio';
const DayButton = styled.button`
@@ -74,14 +55,14 @@ export default function ReserveRegularyForm1({
defaultValues,
});
- const {
- // watch,
- // reset,
- // control,
- setValue,
- // handleSubmit,
- formState: { isSubmitting },
- } = methods;
+ // const {
+ // // watch,
+ // // reset,
+ // // control,
+ // // setValue,
+ // // handleSubmit,
+ // formState: { isSubmitting },
+ // } = methods;
const [startDate, setstartDate] = useState