Files
no-copy-admin-panel-frontend/src/app/[locale]/layout.tsx
T

36 lines
810 B
TypeScript
Raw Normal View History

2026-01-19 16:34:29 +07:00
import Providers from '@/app/providers/getQueryServer'
2026-01-19 12:55:41 +07:00
import { NextIntlClientProvider, hasLocale } from 'next-intl';
import { notFound } from 'next/navigation';
2026-01-19 16:34:29 +07:00
import { routing } from '@/i18n/routing';
2026-01-19 12:55:41 +07:00
import "../styles/globals.css";
import "../styles/global-styles.scss"
2026-04-06 16:08:36 +07:00
export async function generateStaticParams() {
2026-01-19 12:55:41 +07:00
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 (
2026-04-06 17:04:53 +07:00
<html lang={locale}>
2026-04-06 16:08:36 +07:00
<body>
<NextIntlClientProvider>
<Providers>
{children}
</Providers>
</NextIntlClientProvider>
</body>
</html>
2026-01-19 12:55:41 +07:00
);
2026-04-06 16:08:36 +07:00
}