summaryrefslogtreecommitdiff
path: root/src-migrate/common/components/elements/ReCaptcha.tsx
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-11-21 06:10:12 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-11-21 06:10:12 +0000
commit0fc062268c71d53f8777c358b31e2a540d60d404 (patch)
tree0183a00dcfb14583c7dfa80da082c21630afe375 /src-migrate/common/components/elements/ReCaptcha.tsx
parent6ebe202147269100cd63ef125e877e8f693a27a1 (diff)
parent6a6ce21e5a552b0dc6cd541710a87fd0a0fd9d20 (diff)
Merged in refactor/all (pull request #116)
Refactor/all
Diffstat (limited to 'src-migrate/common/components/elements/ReCaptcha.tsx')
-rw-r--r--src-migrate/common/components/elements/ReCaptcha.tsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/src-migrate/common/components/elements/ReCaptcha.tsx b/src-migrate/common/components/elements/ReCaptcha.tsx
new file mode 100644
index 00000000..1bc31d90
--- /dev/null
+++ b/src-migrate/common/components/elements/ReCaptcha.tsx
@@ -0,0 +1,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 \ No newline at end of file