import { GoogleIcon, FacebookIcon, OpenIDIcon, GithubIcon, DiscordIcon, AppleIcon, SamlIcon, } from '@librechat/client'; import SocialButton from './SocialButton'; import { useLocalize } from '~/hooks'; import { TStartupConfig } from 'librechat-data-provider'; function SocialLoginRender({ startupConfig, }: { startupConfig: TStartupConfig | null | undefined; }) { const localize = useLocalize(); if (!startupConfig) { return null; } const providerComponents = { discord: startupConfig.discordLoginEnabled && ( ), facebook: startupConfig.facebookLoginEnabled && ( ), github: startupConfig.githubLoginEnabled && ( ), google: startupConfig.googleLoginEnabled && ( ), apple: startupConfig.appleLoginEnabled && ( ), openid: startupConfig.openidLoginEnabled && ( startupConfig.openidImageUrl ? ( OpenID Logo ) : ( ) } label={startupConfig.openidLabel} id="openid" /> ), saml: startupConfig.samlLoginEnabled && ( startupConfig.samlImageUrl ? ( SAML Logo ) : ( ) } label={startupConfig.samlLabel ? startupConfig.samlLabel : localize('com_auth_saml_login')} id="saml" /> ), }; return ( startupConfig.socialLoginEnabled && ( <> {startupConfig.emailLoginEnabled && ( <>
Or
)}
{startupConfig.socialLogins?.map((provider) => providerComponents[provider] || null)}
) ); } export default SocialLoginRender;