import React from "react"; import styled from "styled-components"; import type { SocialLoginType } from "@appsmith/constants/SocialLogin"; import { getSocialLoginButtonProps } from "@appsmith/constants/SocialLogin"; import type { EventName } from "@appsmith/utils/analyticsUtilTypes"; import AnalyticsUtil from "utils/AnalyticsUtil"; import { useLocation } from "react-router-dom"; import PerformanceTracker, { PerformanceTransactionName, } from "utils/PerformanceTracker"; import { Button } from "design-system"; const ThirdPartyAuthWrapper = styled.div` display: flex; flex-direction: column; gap: var(--ads-v2-spaces-3); `; type SignInType = "SIGNIN" | "SIGNUP"; function SocialLoginButton(props: { logo: string; name: string; url: string; label?: string; type: SignInType; }) { const location = useLocation(); const queryParams = new URLSearchParams(location.search); let url = props.url; const redirectUrl = queryParams.get("redirectUrl"); if (redirectUrl != null) { url += `?redirectUrl=${encodeURIComponent(redirectUrl)}`; } return ( ); } function ThirdPartyAuth(props: { logins: SocialLoginType[]; type: SignInType; }) { const socialLoginButtons = getSocialLoginButtonProps(props.logins).map( (item) => { return ; }, ); return {socialLoginButtons}; } export default ThirdPartyAuth;