mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-07-21 12:20:08 +08:00
21 lines
605 B
TypeScript
21 lines
605 B
TypeScript
import { useColorMode } from "@chakra-ui/react";
|
|
import { Turnstile, TurnstileInstance, TurnstileProps } from "@marsidev/react-turnstile";
|
|
import { forwardRef } from "react";
|
|
|
|
export const CloudFlareCaptcha = forwardRef<TurnstileInstance, Omit<TurnstileProps, "siteKey">>((props, ref) => {
|
|
const { colorMode } = useColorMode();
|
|
return (
|
|
<Turnstile
|
|
ref={ref}
|
|
{...props}
|
|
siteKey={process.env.NEXT_PUBLIC_CLOUDFLARE_CAPTCHA_SITE_KEY}
|
|
options={{
|
|
theme: colorMode,
|
|
...props.options,
|
|
}}
|
|
/>
|
|
);
|
|
});
|
|
|
|
CloudFlareCaptcha.displayName = "CloudFlareCaptcha";
|