'use client'; import React from 'react'; import { Mail, ArrowLeft, AlertCircle, Flag, Shield, CheckCircle2, } from 'lucide-react'; import { Card } from '@/ui/Card'; import { Button } from '@/ui/Button'; import { Input } from '@/ui/Input'; import { Heading } from '@/ui/Heading'; import { Box } from '@/ui/Box'; import { Stack } from '@/ui/Stack'; import { Text } from '@/ui/Text'; import { Link } from '@/ui/Link'; import { Surface } from '@/ui/Surface'; import { Icon } from '@/ui/Icon'; import { LoadingSpinner } from '@/ui/LoadingSpinner'; import { routes } from '@/lib/routing/RouteConfig'; import { ForgotPasswordViewData } from '@/lib/builders/view-data/types/ForgotPasswordViewData'; interface ForgotPasswordTemplateProps { viewData: ForgotPasswordViewData; formActions: { handleChange: (e: React.ChangeEvent) => void; handleSubmit: (e: React.FormEvent) => Promise; setShowSuccess: (show: boolean) => void; }; mutationState: { isPending: boolean; error: string | null; }; } export function ForgotPasswordTemplate({ viewData, formActions, mutationState }: ForgotPasswordTemplateProps) { return ( {/* Background Pattern */} {/* Header */} Reset Password Enter your email and we will send you a reset link {/* Background accent */} {!viewData.showSuccess ? ( {/* Email */} Email Address {viewData.formState.fields.email.error && ( {viewData.formState.fields.email.error} )} {/* Error Message */} {mutationState.error && ( {mutationState.error} )} {/* Submit Button */} {/* Back to Login */} Back to Login ) : ( {viewData.successMessage} {viewData.magicLink && ( Development Mode - Magic Link: {viewData.magicLink} In production, this would be sent via email )} )} {/* Trust Indicators */} Secure reset process 15 minute expiration {/* Footer */} Need help?{' '} Contact support ); }