"use client"; import { useState } from "react"; import Link from "next/link"; import { Code2, Loader2, Mail } from "lucide-react"; import { cn } from "@/lib/utils"; export default function VerifyEmailPage() { const [loading, setLoading] = useState(false); const [message, setMessage] = useState(""); const [error, setError] = useState(""); async function handleResend() { setLoading(true); setMessage(""); setError(""); try { const res = await fetch("/api/auth/resend-verification", { method: "POST" }); if (!res.ok) { const data: { error?: string } = await res.json(); setError(data.error ?? "Failed to resend email"); setLoading(false); return; } setMessage("Verification email sent! Check your inbox."); } catch { setError("Something went wrong."); } finally { setLoading(false); } } return (

Check your email

We sent a verification link to your inbox

Click the link in the email to verify your account. The link expires in 24 hours.

{message && (

{message}

)} {error && (

{error}

)}

Already verified?{" "}Sign in

); }