'use client'; import { useActionState } from 'react'; import { resendCodeAction, verifyEmailAction } from '@/lib/auth/actions'; import { idle } from '@/lib/auth/state'; import { CodeInput, Cooldown, FormMessage, SubmitButton } from '@/components/account/form'; export function VerifyForm() { const [state, action] = useActionState(verifyEmailAction, idle); const [resend, resendAction] = useActionState(resendCodeAction, idle); const cooldown = typeof resend.data?.retryAfter === 'number' ? resend.data.retryAfter : resend.ok ? 45 : 0; return (