File size: 488 Bytes
7e5cb25
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"use client"
import ReCAPTCHA from "react-google-recaptcha"
import { useState } from "react"

export default function CaptchaInput() {
  const [recaptchaValue, setRecaptchaValue] = useState(null)

  return (
    <>
      <input
        type="hidden"
        name="g-recaptcha-response"
        value={recaptchaValue || ""}
      />
      <ReCAPTCHA
        sitekey={process.env.NEXT_PUBLIC_RECAPTCHA_SITE_KEY}
        onChange={(value) => setRecaptchaValue(value)}
      />
    </>
  )
}