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

52 lines
1.4 KiB
TypeScript
Raw Normal View History

2026-01-19 12:55:41 +07:00
import type { Metadata } from "next";
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 { getQueryClient } from '@/app/providers/getQueryClient';
import { HydrationBoundary, dehydrate } from '@tanstack/react-query';
import { prefetchLayoutQueries } from '@/app/lib/prefetch-queries';
import { routing } from '@/i18n/routing';
2026-04-06 16:08:36 +07:00
import AdminLayoutWrapper from '@/app/components/admin-layout-wrapper';
2026-01-19 16:34:29 +07:00
2026-04-06 16:08:36 +07:00
// @ts-expect-error - CSS modules types not defined
2026-01-19 12:55:41 +07:00
import "../styles/globals.css";
2026-04-06 16:08:36 +07:00
// @ts-expect-error - CSS modules types not defined
2026-01-19 12:55:41 +07:00
import "../styles/global-styles.scss"
export const metadata: Metadata = {
title: "Admin panel no copy",
description: "Admin panel no copy",
};
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;
2026-04-06 16:08:36 +07:00
2026-01-19 12:55:41 +07:00
if (!hasLocale(routing.locales, locale)) {
notFound();
}
2026-01-19 16:34:29 +07:00
const queryClient = getQueryClient();
await prefetchLayoutQueries(queryClient);
2026-01-19 12:55:41 +07:00
return (
<html lang="en">
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
}