import React, { useRef, useState } from "react"; import styled from "styled-components"; import { IButtonProps, MaybeElement, Button, Alignment, Position, } from "@blueprintjs/core"; import { IconName } from "@blueprintjs/icons"; import Tooltip from "components/ads/Tooltip"; import { ComponentProps } from "widgets/BaseComponent"; import { useScript, ScriptStatus } from "utils/hooks/useScript"; import { GOOGLE_RECAPTCHA_KEY_ERROR, GOOGLE_RECAPTCHA_DOMAIN_ERROR, createMessage, } from "constants/messages"; import { ThemeProp, Variant } from "components/ads/common"; import { Toaster } from "components/ads/Toast"; import ReCAPTCHA from "react-google-recaptcha"; import { Colors } from "../../../constants/Colors"; import _ from "lodash"; import { ButtonBoxShadow, ButtonBoxShadowTypes, ButtonBorderRadius, ButtonBorderRadiusTypes, ButtonVariant, ButtonVariantTypes, } from "components/constants"; import { getCustomBackgroundColor, getCustomBorderColor, getCustomHoverColor, getCustomTextColor, } from "widgets/WidgetUtils"; const RecaptchaWrapper = styled.div` position: relative; .grecaptcha-badge { visibility: hidden; } `; const ToolTipWrapper = styled.div` height: 100%; && .bp3-popover-target { height: 100%; & > div { height: 100%; } } `; const ButtonContainer = styled.div` display: flex; align-items: center; justify-content: center; height: 100%; & > button { height: 100%; } `; const StyledButton = styled((props) => (