'use client'; import { useState } from 'react'; import Link from 'next/link'; import { authService, AuthService } from '@/services'; export default function ForgotPasswordPage() { const [email, setEmail] = useState(''); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const [submitted, setSubmitted] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(''); try { await authService.forgotPassword({ email }); setSubmitted(true); } catch (err) { setError(AuthService.getErrorMessage(err)); } finally { setLoading(false); } }; return (
{/* Logo */}
RE-QuestN
{submitted ? ( /* Success Message */

Check Your Email

We've sent a password reset link to {email}. Please check your inbox and spam folder.

Back to Login
) : ( <> {/* Forgot Password Heading */}

Forgot Password

Enter your email address and we'll send you a link to reset your password

{/* Forgot Password Form */}
{error && (
{error}
)} {/* Email Input */}
setEmail(e.target.value)} required className="w-full px-6 py-6 bg-[#f0f5fc] rounded-[20px] text-[#00293d] text-sm font-light placeholder:text-[#00293d] focus:outline-none focus:ring-2 focus:ring-[#00293d]/20 transition-all" />
{/* Submit Button */}
{/* Back to Login */}
Back to Login
)}
); }