"use client"; import Script from "next/script"; export type CaptchaPublicConfig = { provider: string; siteKey?: string; field?: string; }; /** Renders Turnstile / reCAPTCHA widget + script when a provider is configured. */ export function CaptchaWidget({ captcha, nonce, className, }: { captcha: CaptchaPublicConfig; nonce?: string; className?: string; }) { const showCaptcha = captcha.provider !== "none" && !!captcha.siteKey; if (!showCaptcha) return null; return (
{captcha.provider === "turnstile" ? ( <>