ReCaptcha.tsx 605 B

123456789101112131415161718192021222324
  1. import { Flex } from "reflexbox/styled-components";
  2. import getConfig from "next/config";
  3. import React from "react";
  4. const { publicRuntimeConfig } = getConfig();
  5. const ReCaptcha = () => {
  6. if (process.env.NODE_ENV !== "production") return null;
  7. if (!publicRuntimeConfig.RECAPTCHA_SITE_KEY) return null;
  8. return (
  9. <Flex
  10. margin="54px 0 16px"
  11. id="g-recaptcha"
  12. className="g-recaptcha"
  13. data-sitekey={publicRuntimeConfig.RECAPTCHA_SITE_KEY}
  14. data-callback="recaptchaCallback"
  15. data-size="invisible"
  16. data-badge="inline"
  17. />
  18. );
  19. };
  20. export default ReCaptcha;