ReCaptcha.tsx 645 B

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