import { useLocalize } from '~/hooks';
import { BlinkAnimation } from './BlinkAnimation';
import { TStartupConfig } from 'librechat-data-provider';
import SocialLoginRender from './SocialLoginRender';
import { ThemeSelector } from '~/components/ui';
import { Banner } from '../Banners';
import Footer from './Footer';
const ErrorRender = ({ children }: { children: React.ReactNode }) => (
);
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: string | null;
}) {
const localize = useLocalize();
const DisplayError = () => {
if (startupConfigError !== null && startupConfigError !== undefined) {
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) {
return {localize(error)};
}
return null;
};
return (
{!startupConfigError && !isFetching && (
{header}
)}
{children}
{(pathname.includes('login') || pathname.includes('register')) && (
)}
);
}
export default AuthLayout;