From cf6da809621b4ebe8c9acedb035b689e7e1b60b1 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Wed, 25 Oct 2023 17:27:32 +0700
Subject: Update register page

---
 src-migrate/common/components/elements/ReCaptcha.tsx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 src-migrate/common/components/elements/ReCaptcha.tsx

(limited to 'src-migrate/common/components/elements/ReCaptcha.tsx')

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
-- 
cgit v1.2.3

