import { Stack, Button } from '@chakra-ui/react' import { GithubIcon } from 'assets/icons' import { ClientSafeProvider, LiteralUnion, signIn, useSession, } from 'next-auth/react' import { useRouter } from 'next/router' import React from 'react' import { stringify } from 'qs' import { FacebookLogo, GoogleLogo, GitlabLogo, AzureAdLogo } from 'assets/logos' import { BuiltInProviderType } from 'next-auth/providers' type Props = { providers: | Record, ClientSafeProvider> | undefined } export const SocialLoginButtons = ({ providers }: Props) => { const { query } = useRouter() const { status } = useSession() const handleGitHubClick = async () => signIn('github', { callbackUrl: `/typebots?${stringify(query)}`, }) const handleGoogleClick = async () => signIn('google', { callbackUrl: `/typebots?${stringify(query)}`, }) const handleFacebookClick = async () => signIn('facebook', { callbackUrl: `/typebots?${stringify(query)}`, }) const handleGitlabClick = async () => signIn('gitlab', { callbackUrl: `/typebots?${stringify(query)}`, }) const handleAzureAdClick = async () => signIn('azure-ad', { callbackUrl: `/typebots?${stringify(query)}`, }) return ( {providers?.github && ( )} {providers?.google && ( )} {providers?.facebook && ( )} {providers?.gitlab && ( )} {providers?.['azure-ad'] && ( )} ) }