66 lines
1.9 KiB
TypeScript
66 lines
1.9 KiB
TypeScript
import type { Metadata } from "next";
|
|
import Script from "next/script";
|
|
import { Cormorant_Garamond, Plus_Jakarta_Sans } from "next/font/google";
|
|
import { NextIntlClientProvider } from 'next-intl';
|
|
import { getMessages, setRequestLocale } from 'next-intl/server';
|
|
import { routing } from '@/i18n/routing';
|
|
import { notFound } from 'next/navigation';
|
|
import { MarmarisWidget } from '@/components/MarmarisWidget';
|
|
import "../globals.css";
|
|
|
|
const cormorant = Cormorant_Garamond({
|
|
variable: "--font-cormorant",
|
|
subsets: ["latin"],
|
|
weight: ["300", "400", "500", "600", "700"],
|
|
style: ["normal", "italic"],
|
|
display: "swap",
|
|
});
|
|
|
|
const jakarta = Plus_Jakarta_Sans({
|
|
variable: "--font-jakarta",
|
|
subsets: ["latin"],
|
|
weight: ["300", "400", "500", "600", "700"],
|
|
display: "swap",
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Moy Beach Akyaka | Menü",
|
|
description: "Moy Beach Akyaka dijital menü.",
|
|
};
|
|
|
|
export function generateStaticParams() {
|
|
return routing.locales.map((locale) => ({ locale }));
|
|
}
|
|
|
|
export default async function LocaleLayout({
|
|
children,
|
|
params
|
|
}: {
|
|
children: React.ReactNode;
|
|
params: Promise<{ locale: string }>;
|
|
}) {
|
|
const { locale } = await params;
|
|
|
|
if (!routing.locales.includes(locale as any)) {
|
|
notFound();
|
|
}
|
|
|
|
setRequestLocale(locale);
|
|
const messages = await getMessages();
|
|
|
|
return (
|
|
<html lang={locale} className={`${cormorant.variable} ${jakarta.variable} h-full`}>
|
|
<body className="min-h-full flex flex-col antialiased" suppressHydrationWarning>
|
|
<NextIntlClientProvider messages={messages}>
|
|
{children}
|
|
</NextIntlClientProvider>
|
|
|
|
{/* VPS Panel Analytics */}
|
|
<Script src="https://panel.ayris.tech/api/analytics/script" data-domain="http://menu.moybeachakyaka.com" strategy="afterInteractive" />
|
|
|
|
<MarmarisWidget locale={locale} style={{ display: "none" }} />
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|