import React, { useState } from 'react'; import { Button } from '../../ui/button'; import { XerticaLogo } from '../../brand/xertica-logo'; import { AuthPageShell, SocialLoginButtons } from '../../blocks/auth'; import { ArrowLeft, Mail, CheckCircle2 } from 'lucide-react'; import { useNavigate, useLocation } from 'react-router-dom'; import { useTranslation } from 'react-i18next'; import { useBrandColors } from '../../../contexts/BrandColorsContext'; /** * Email Verification Page component. * * @description * An informative screen shown after a password reset request. It instructs * the user to check their email and provides a "Resend email" feature. * Includes the same consistent layout as the other auth pages, including the * theme-conditional isotype/hero-image left panel. * * @ai-rules * 1. Data Source: It retrieves the email from the router's `location.state`. * 2. Visual Feedback: Displays a temporary success message upon successful resale of the verification email. * 3. Navigation: Includes a link to return to the `LoginPage`. */ export function VerifyEmailPage() { const navigate = useNavigate(); const location = useLocation(); const { t } = useTranslation(); const { currentTheme } = useBrandColors(); const email = location.state?.email || 'your@email.com'; const [isResending, setIsResending] = useState(false); const [resendSuccess, setResendSuccess] = useState(false); const handleResend = async () => { setIsResending(true); setResendSuccess(false); // Simulate email resending await new Promise(resolve => setTimeout(resolve, 1500)); setIsResending(false); setResendSuccess(true); // Remove success message after 3 seconds setTimeout(() => setResendSuccess(false), 3000); }; const handleSocialLogin = (_provider: string) => { // Wire your SSO/social provider integration here }; const content = ( <>
{t('verifyEmail.instructionsSent')}
{email}
{t('verifyEmail.instructions')}
{t('verifyEmail.notReceived')}