47 lines
1.1 KiB
TypeScript
47 lines
1.1 KiB
TypeScript
import type { Metadata } from "next";
|
|||
|
|
import { NextIntlClientProvider, hasLocale } from 'next-intl';
|
||
|
|
import { routing } from '@/i18n/routing';
|
||
|
|
import { notFound } from 'next/navigation';
|
||
|
|
import AdminNavLinks from '@/app/ui/admin-nav-links'
|
||
|
|
import AdminHeaderPanel from '@/app/ui/admin-header-panel';
|
||
|
|
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();
|
||
|
|
}
|
||
|
|
|
||
|
|
return (
|
||
|
|
<html lang="en">
|
||
|
|
<body className="admin-panel">
|
||
|
|
<NextIntlClientProvider>
|
||
|
|
<AdminNavLinks />
|
||
|
|
<div className="admin-main">
|
||
|
|
<AdminHeaderPanel />
|
||
|
|
<main className="main-containter">
|
||
|
|
{children}
|
||
|
|
</main>
|
||
|
|
</div>
|
||
|
|
</NextIntlClientProvider>
|
||
|
|
</body>
|
||
|
|
</html >
|
||
|
|
);
|
||
|
|
}
|