import { useState } from 'react'; import styles from "../components/Form/form.module.scss"; const StudyPlanEditPage = () => { const [studyplan, setStudyplan] = useState({ title: "", endDate: "", endTime: "", contents: "", deadline: "", }) function handleChange(e) { const { name, value } = e.target if (name === "deadline") { studyplan.deadline !== "on" ? setStudyplan({ ...studyplan, [name]: value }) : setStudyplan({ ...studyplan, [name]: "off" }) } else { setStudyplan({ ...studyplan, [name]: value }) } } return ( <>