"use client"; import { useState, Suspense } from "react"; import { Card, CardContent } from "~/components/ui/card"; import { Input } from "~/components/ui/input"; import { Button } from "~/components/ui/button"; import { Label } from "~/components/ui/label"; import { toast } from "sonner"; import { Logo } from "~/components/branding/logo"; import { LegalModal } from "~/components/ui/legal-modal"; import { Mail, ArrowRight, ArrowLeft, Shield, Clock, CheckCircle, } from "lucide-react"; function ForgotPasswordForm() { const [email, setEmail] = useState(""); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); async function handleSubmit(e: React.FormEvent) { e.preventDefault(); setLoading(true); try { const response = await fetch("/api/auth/forgot-password", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify({ email }), }); const data = (await response.json()) as { error?: string }; if (response.ok) { setSent(true); toast.success("Password reset instructions sent to your email"); } else { toast.error(data.error ?? "Failed to send reset email"); } } catch { toast.error("An error occurred. Please try again."); } finally { setLoading(false); } } if (sent) { return (
{/* Hero Section - Hidden on mobile */}

Check your email inbox

We've sent password reset instructions to your email address. Follow the link to create a new password.

Check your inbox

Look for an email from beenvoice with reset instructions

Link expires soon

The reset link is valid for 24 hours only

Secure Process

Your account security is our top priority

Email sent successfully

Follow the instructions in your email to reset your password

{/* Success Message */}
{/* Mobile Logo */}

Check your email

We've sent password reset instructions to{" "} {email}

What's next?

  • 1. Check your email inbox (and spam folder)
  • 2. Click the reset link in the email
  • 3. Create a new secure password
Didn't receive the email? Check your spam folder or{" "} .
); } return (
{/* Hero Section - Hidden on mobile */}

Forgot your password?

No worries! Enter your email address and we'll send you instructions to reset your password.

Email Instructions

We'll send a secure link to your email address

Quick Process

Reset your password in just a few clicks

Secure & Safe

Your account security is our top priority

{/* Forgot Password Form */}
{/* Mobile Logo */}

Forgot Password

Enter your email and we'll send you reset instructions

setEmail(e.target.value)} required autoFocus className="h-11 pl-10" placeholder="Enter your email address" />

Check your spam folder

Sometimes our emails end up in spam or promotions folders

Remember your password?{" "} Sign in instead
By using our service, you agree to our{" "} Terms of Service } />{" "} and{" "} Privacy Policy } /> .
); } export default function ForgotPasswordPage() { return ( Loading...}> ); }