summaryrefslogtreecommitdiff
path: root/src-migrate/common/components/elements/ReCaptcha.tsx
blob: 1bc31d90fe5adb36625fa9f2b36a805b5d08f237 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import ReCAPTCHA, { ReCAPTCHAProps } from "react-google-recaptcha"

const GOOGLE_RECAPTCHA_KEY = process.env.NEXT_PUBLIC_RECAPTCHA_GOOGLE || ''

type Props = Omit<ReCAPTCHAProps, 'sitekey'> & {
  sitekey?: string;
}

const ReCaptcha = (props: Props) => {
  const { sitekey, ...rest } = props

  return (
    <ReCAPTCHA sitekey={sitekey || GOOGLE_RECAPTCHA_KEY} {...rest} />
  )
}

export default ReCaptcha