"use client"; import { Mail } from "lucide-react"; import { useTranslations } from "next-intl"; import { useActionState, useId } from "react"; import { type ResendVerificationState, resendVerification, } from "@/actions/verify"; const INITIAL_STATE: ResendVerificationState = { ok: false, error: null }; /** * Lets a visitor whose verification token expired or was mangled request a * fresh mail straight from the invalid card of /verify. The server answers * identically for unknown addresses, so no registered address can be probed; * the live feedback is limited to "we tried" vs "throttled". */ export function ResendVerificationForm() { const t = useTranslations("pages.verify"); const fieldId = useId(); const [state, formAction, isPending] = useActionState( resendVerification, INITIAL_STATE, ); return (
{state.ok ? (

{t("resendSent")}

) : state.error ? (

{t("resendFailed")}

) : null}
); }