added admin layout

This commit is contained in:
2024-04-27 00:40:27 +03:00
parent f17a002ac6
commit db66161d81
15 changed files with 566 additions and 36 deletions

View File

@@ -4,6 +4,8 @@ import { ReactElement } from 'react'
import { I18nProviderClient } from '@/locales/client'
import { lc } from '@/lib/utils'
import './globals.css'
import { SessionProvider } from 'next-auth/react'
import { auth } from '@/config/auth'
const inter = Inter({ subsets: ['cyrillic'] })
@@ -15,13 +17,16 @@ type RootLayoutProps = {
params: { locale: string }; children: ReactElement;
}
export default function RootLayout ({ params: { locale }, children }: Readonly<RootLayoutProps>) {
export default async function RootLayout ({ params: { locale }, children }: Readonly<RootLayoutProps>) {
const session = await auth()
return (<html lang={lc(locale)?.java}>
<body className={inter.className}>
<I18nProviderClient locale={locale} fallback="Loading...">
{children}
</I18nProviderClient>
</body>
</html>)
return (<SessionProvider session={session}>
<html lang={lc(locale)?.java}>
<body className={inter.className}>
<I18nProviderClient locale={locale} fallback="Loading...">
{children}
</I18nProviderClient>
</body>
</html>
</SessionProvider>)
}