import { GoogleIcon, FacebookIcon, OpenIDIcon, GithubIcon, DiscordIcon } from '~/components'; 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 && ( ), openid: startupConfig?.openidLoginEnabled && ( startupConfig.openidImageUrl ? ( OpenID Logo ) : ( ) } label={startupConfig.openidLabel} id="openid" /> ), }; return ( startupConfig.socialLoginEnabled && ( <> {startupConfig.emailLoginEnabled && ( <>
Or
)}
{startupConfig.socialLogins?.map((provider) => providerComponents[provider] || null)}
) ); } export default SocialLoginRender;