import { useState } from 'react'; import { forgotPassword } from '../../services/api'; import { Link } from 'react-router-dom'; export default function ForgotPassword() { const [email, setEmail] = useState(''); const [status, setStatus] = useState({ type: '', message: '' }); const [loading, setLoading] = useState(false); const handleSubmit = async (e) => { e.preventDefault(); setLoading(true); setStatus({ type: '', message: '' }); try { await forgotPassword(email); setStatus({ type: 'success', message: 'If an account exists with this email, you will receive password reset instructions.' }); setEmail(''); } catch (error) { setStatus({ type: 'error', message: 'Failed to process request. Please try again.' }); } finally { setLoading(false); } }; return (

Forgot your password?

Enter your email address and we'll send you instructions to reset your password.

{status.message && (
{status.message}
)}
setEmail(e.target.value)} className="appearance-none relative block w-full px-3 py-2 border border-primary-600 bg-primary-700/30 placeholder-neutral-400 text-white rounded-lg focus:outline-none focus:ring-primary-500 focus:border-primary-500 focus:z-10 sm:text-sm" placeholder="Email address" />
Back to login
); }