/** * Forgot Password Template * * Pure presentation component that accepts ViewData only. * No business logic, no state management. */ 'use client'; import Link from 'next/link'; import { motion } from 'framer-motion'; import { Mail, ArrowLeft, AlertCircle, Flag, Shield, CheckCircle2, } from 'lucide-react'; import Card from '@/components/ui/Card'; import Button from '@/components/ui/Button'; import Input from '@/components/ui/Input'; import Heading from '@/components/ui/Heading'; import { ForgotPasswordViewData } from '@/lib/builders/view-data/types/ForgotPasswordViewData'; interface ForgotPasswordTemplateProps { viewData: ForgotPasswordViewData; formActions: { setFormData: React.Dispatch>; 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 */}
formActions.setFormData({ email: e.target.value })} error={!!viewData.formState.fields.email.error} errorMessage={viewData.formState.fields.email.error} placeholder="you@example.com" disabled={mutationState.isPending} className="pl-10" autoComplete="email" />
{/* 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

); }