import React,{ useState } from 'react' let Setadmins = [] let Setadmin = {} function AdminSetting() { const [password, setPassword] = useState('') const [adminpassword, setAdminPassword] = useState('') const [time, setTime] = useState('') const handleChangePassword = (event) => { Setadmin['password'] = event.target.value setPassword(event.target.value) } const handleChangeAdminPassword = (event) => { Setadmin['AdminPassword'] = event.target.value setAdminPassword(event.target.value) } const handleChangeTime = (event) => { Setadmin['Time'] = event.target.value setTime(event.target.value) } function handleClick() { if (!password) { alert('비밀번호가 입력되지 않았습니다.') } else if (!adminpassword) { alert('관리자 비밀번호가 입력되지 않았습니다.') } else if (!time) { alert('제한시간이 입력되지 않았습니다.') //타임은 조건은 빼도 될 듯 } else { Setadmins.push(Setadmin) localStorage.setItem('Set', JSON.stringify(Setadmins)) console.log(Setadmins) alert('저장이 완료되었습니다.') console.log(Setadmin) // setDoneset(true) } } return (