runtipi/src/app/(auth)/layout.tsx
2023-11-26 09:13:06 +01:00

37 lines
1.1 KiB
TypeScript

import React from 'react';
import Image from 'next/image';
import { getCurrentLocale } from 'src/utils/getCurrentLocale';
import { getLogo } from '@/lib/themes';
import { getConfig } from '@/server/core/TipiConfig';
import { LanguageSelector } from '../components/LanguageSelector';
export default async function AuthLayout({ children }: { children: React.ReactNode }) {
const locale = getCurrentLocale();
const { allowAutoThemes } = getConfig();
return (
<div className="page page-center">
<div className="position-absolute top-0 mt-3 end-0 me-1 pb-4">
<LanguageSelector locale={locale} />
</div>
<div className="container container-tight py-4">
<div className="text-center mb-4">
<Image
alt="Tipi logo"
src={getLogo(allowAutoThemes)}
height={50}
width={50}
style={{
maxWidth: '100%',
height: 'auto',
}}
/>
</div>
<div className="card card-md">
<div className="card-body">{children}</div>
</div>
</div>
</div>
);
}