import React, { useState } from 'react'; import { useParams } from 'react-router-dom'; import { Eye, EyeOff } from 'lucide-react'; const PasswordReset = () => { const [password, setPassword] = useState(''); const [confirmPassword, setConfirmPassword] = useState(''); const [showPassword, setShowPassword] = useState(false); const [message, setMessage] = useState(''); const { uid, token } = useParams(); const handleSubmit = async (e) => { e.preventDefault(); if (password !== confirmPassword) { setMessage('パスワードが一致しません。'); return; } try { const response = await fetch(`/api/reset-password/${uid}/${token}/`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ new_password: password }), }); const data = await response.json(); if (response.ok) { setMessage('パスワードが正常にリセットされました。'); } else { setMessage(data.message || 'パスワードのリセットに失敗しました。'); } } catch (error) { setMessage('エラーが発生しました。もう一度お試しください。'); } }; return (