'use client'; import { useState } from 'react'; import { Link } from '@/i18n/navigation'; import Image from 'next/image'; import { useTranslations } from 'next-intl'; import { forgotPassword } from '@/lib/api/auth'; export default function ForgotPasswordPage() { const t = useTranslations('auth.forgotPassword'); const tFooter = useTranslations('auth.footerLinks'); const [email, setEmail] = useState(''); const [success, setSuccess] = useState(false); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setLoading(true); try { await forgotPassword(email); setSuccess(true); } catch (err: any) { setError(err.message || t('error')); } finally { setLoading(false); } }; return (
Xpeditis
{success ? ( <>

{t('successTitle')}

{t('successHint')}

{t('backToLogin')} ) : ( <>

{t('title')}

{t('subtitle')}

{error && (

{error}

)}
setEmail(e.target.value)} className="input w-full" placeholder={t('emailPlaceholder')} autoComplete="email" disabled={loading} />
{t('backToLogin')}
)}
{tFooter('contact')} {tFooter('privacy')} {tFooter('terms')}

{t('sidePanel.title')}

{t('sidePanel.description')}

{t('sidePanel.features.secure.title')}

{t('sidePanel.features.secure.description')}

{t('sidePanel.features.email.title')}

{t('sidePanel.features.email.description')}

); }