'use client'; import { useState } from "react"; type Props = { open: boolean; onClose: () => void; onSubmit?: (payload: { email: string; code: string; newPassword: string }) => void; }; export default function ChangePasswordModal({ open, onClose, onSubmit }: Props) { const [email, setEmail] = useState("xrlms2025@gmail.com"); const [code, setCode] = useState(""); const [newPassword, setNewPassword] = useState(""); const [confirmPassword, setConfirmPassword] = useState(""); const [error, setError] = useState(null); // 인증번호 오류 등 if (!open) return null; const handleSubmit = () => { setError(null); if (!code) { setError("인증번호를 입력해 주세요."); return; } if (!newPassword || !confirmPassword) { setError("새 비밀번호를 입력해 주세요."); return; } if (newPassword !== confirmPassword) { setError("새 비밀번호가 일치하지 않습니다."); return; } onSubmit?.({ email, code, newPassword }); onClose(); }; return (
{/* header */}

비밀번호 변경

{/* body */}
setEmail(e.target.value)} className="h-10 flex-1 rounded-[8px] border border-[#dee1e6] bg-white px-3 text-[16px] leading-[1.5] text-[#333c47] placeholder-[#b1b8c0] outline-none" placeholder="이메일" />
인증번호
setCode(e.target.value)} className="h-10 flex-1 rounded-[8px] border border-[#dee1e6] bg-white px-3 text-[16px] leading-[1.5] text-[#333c47] placeholder-[#b1b8c0] outline-none" placeholder="인증번호 6자리" />
{error ? (

{error}

) : null}
setNewPassword(e.target.value)} className="h-10 rounded-[8px] border border-[#dee1e6] bg-neutral-50 px-3 text-[16px] leading-[1.5] text-[#333c47] placeholder-[#b1b8c0] outline-none" placeholder="새 비밀번호" />
setConfirmPassword(e.target.value)} className="h-10 rounded-[8px] border border-[#dee1e6] bg-neutral-50 px-3 text-[16px] leading-[1.5] text-[#333c47] placeholder-[#b1b8c0] outline-none" placeholder="새 비밀번호 확인" />
{/* footer */}
); }