Files
no-copy-admin-panel-frontend/src/app/[locale]/layout.tsx
T
2026-04-06 17:14:23 +07:00

36 lines
810 B
TypeScript

import Providers from '@/app/providers/getQueryServer'
import { NextIntlClientProvider, hasLocale } from 'next-intl';
import { notFound } from 'next/navigation';
import { routing } from '@/i18n/routing';
import "../styles/globals.css";
import "../styles/global-styles.scss"
export async function generateStaticParams() {
return routing.locales.map((locale: any) => ({ locale }));
}
export default async function RootLayout({
children,
params
}: Readonly<{
children: React.ReactNode;
params: Promise<{ locale: string }>;
}>) {
const { locale } = await params;
if (!hasLocale(routing.locales, locale)) {
notFound();
}
return (
<html lang={locale}>
<body>
<NextIntlClientProvider>
<Providers>
{children}
</Providers>
</NextIntlClientProvider>
</body>
</html>
);
}