import { TranslationKeys, useLocalize } from '~/hooks'; import { TStartupConfig } from 'librechat-data-provider'; import { ErrorMessage } from '~/components/Auth/ErrorMessage'; import SocialLoginRender from './SocialLoginRender'; import { BlinkAnimation } from './BlinkAnimation'; import { ThemeSelector } from '~/components'; import { Banner } from '../Banners'; import Footer from './Footer'; function AuthLayout({ children, header, isFetching, startupConfig, startupConfigError, pathname, error, }: { children: React.ReactNode; header: React.ReactNode; isFetching: boolean; startupConfig: TStartupConfig | null | undefined; startupConfigError: unknown | null | undefined; pathname: string; error: TranslationKeys | null; }) { const localize = useLocalize(); const hasStartupConfigError = startupConfigError !== null && startupConfigError !== undefined; const DisplayError = () => { if (hasStartupConfigError) { return (
{localize('com_auth_error_login_server')}
); } else if (error === 'com_auth_error_invalid_reset_token') { return (
{localize('com_auth_error_invalid_reset_token')}{' '} {localize('com_auth_click_here')} {' '} {localize('com_auth_to_try_again')}
); } else if (error != null && error) { return (
{localize(error)}
); } return null; }; return (
{localize('com_ui_logo',
{!hasStartupConfigError && !isFetching && (

{header}

)} {children} {!pathname.includes('2fa') && (pathname.includes('login') || pathname.includes('register')) && ( )}
); } export default AuthLayout;