'use client'; import { useState } from 'react'; import Link from 'next/link'; import { useSearchParams } from 'next/navigation'; import { Suspense } from 'react'; import { Video, Mail, Loader2 } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Input } from '@/components/ui/input'; function VerifyEmailContent() { const searchParams = useSearchParams(); const emailParam = searchParams.get('email') || ''; const [resendEmail, setResendEmail] = useState(emailParam); const [loading, setLoading] = useState(false); const [sent, setSent] = useState(false); const [error, setError] = useState(''); const handleResend = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(''); try { const res = await fetch('/api/auth/verify-email/resend', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email: resendEmail }), }); if (res.ok) { setSent(true); } else { setError('Something went wrong. Please try again.'); } } catch { setError('Something went wrong. Please try again.'); } finally { setLoading(false); } }; return (
The link expires in 2 hours. Check your spam folder if you don't see it.
{sent ? (Already verified?{' '} Sign in