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-01-22 17:30:46 +07:00
|
|
|
import AdminNavLinks from '@/app/ui/navigation/admin-nav-links'
|
2026-01-19 12:55:41 +07:00
|
|
|
import AdminHeaderPanel from '@/app/ui/admin-header-panel';
|
2026-01-19 16:34:29 +07:00
|
|
|
|
2026-01-19 12:55:41 +07:00
|
|
|
import "../styles/globals.css";
|
|
|
|
|
import "../styles/global-styles.scss"
|
|
|
|
|
|
|
|
|
|
export const metadata: Metadata = {
|
|
|
|
|
title: "Admin panel no copy",
|
|
|
|
|
description: "Admin panel no copy",
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export 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();
|
|
|
|
|
}
|
|
|
|
|
|
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-01-19 16:34:29 +07:00
|
|
|
<NextIntlClientProvider>
|
|
|
|
|
<Providers>
|
|
|
|
|
<HydrationBoundary state={dehydrate(queryClient)}>
|
|
|
|
|
<body className="admin-panel">
|
|
|
|
|
<AdminNavLinks />
|
|
|
|
|
<div className="admin-main">
|
|
|
|
|
<AdminHeaderPanel />
|
|
|
|
|
<main className="main-containter">
|
|
|
|
|
{children}
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</body>
|
|
|
|
|
</HydrationBoundary>
|
|
|
|
|
</Providers>
|
|
|
|
|
</NextIntlClientProvider>
|
2026-01-19 12:55:41 +07:00
|
|
|
</html >
|
|
|
|
|
);
|
|
|
|
|
}
|