"use client"; import { Turnstile } from "@marsidev/react-turnstile"; import { useState, useEffect } from "react"; const SITE_KEY = process.env.NEXT_PUBLIC_TURNSTILE_SITE_KEY; export default function TurnstileWidget({ onVerify, }: { onVerify: (token: string) => void; }) { const [mounted, setMounted] = useState(false); const [error, setError] = useState(false); useEffect(() => { setMounted(true); }, []); if (!SITE_KEY) { return null; } if (!mounted) { return
; } if (error) { return (Security check unavailable
); } return (