From f62b2345f463695ef0f8f79830cd76b6e0332821 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Sat, 13 Jan 2024 10:35:22 +0700
Subject: Refactor src migrate folder

---
 src-migrate/components/ui/re-captcha.tsx | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 src-migrate/components/ui/re-captcha.tsx

(limited to 'src-migrate/components/ui/re-captcha.tsx')

diff --git a/src-migrate/components/ui/re-captcha.tsx b/src-migrate/components/ui/re-captcha.tsx
new file mode 100644
index 00000000..e31aa1e3
--- /dev/null
+++ b/src-migrate/components/ui/re-captcha.tsx
@@ -0,0 +1,15 @@
+import ReCAPTCHA, { ReCAPTCHAProps } from "react-google-recaptcha"
+
+const GOOGLE_RECAPTCHA_KEY = process.env.NEXT_PUBLIC_RECAPTCHA_GOOGLE || ''
+
+export interface ReCaptchaProps extends Omit<ReCAPTCHAProps, 'sitekey'> {
+  sitekey?: string;
+}
+
+export const ReCaptcha = (props: ReCaptchaProps) => {
+  const { sitekey, ...rest } = props
+
+  return (
+    <ReCAPTCHA sitekey={sitekey || GOOGLE_RECAPTCHA_KEY} {...rest} />
+  )
+}
-- 
cgit v1.2.3

