import React, { useState } from 'react'; import { Button } from '../../ui/button'; import { Input } from '../../ui/input'; import { Label } from '../../ui/label'; import { XerticaLogo } from '../../brand/xertica-logo'; import { AuthPageShell, SocialLoginButtons } from '../../blocks/auth'; import { ArrowLeft } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { useBrandColors } from '../../../contexts/BrandColorsContext'; /** * Forgot Password Page component. * * @description * A screen that allows users to request a password reset link via email. * Includes a side-panel (desktop) and alternative social login options * similar to the main Login page. * * @ai-rules * 1. Navigation: Successfully submitting the email triggers a navigation to `/verify-email`. * 2. Visuals: Keeps consistency with `LoginPage` in terms of layout and branding, including * the theme-conditional isotype/hero-image left panel. */ export function ForgotPasswordPage() { const navigate = useNavigate(); const { t } = useTranslation(); const { currentTheme } = useBrandColors(); const [email, setEmail] = useState(''); const [isLoading, setIsLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true); // Simulate email sending await new Promise(resolve => setTimeout(resolve, 1500)); // Navigate to verification screen navigate('/verify-email', { state: { email } }); setIsLoading(false); }; const handleSocialLogin = (_provider: string) => { // Wire your SSO/social provider integration here }; const content = ( <>
{t('forgotPassword.subheading')}