48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
import { NextIntlClientProvider } from 'next-intl';
|
||
import { getMessages } from 'next-intl/server';
|
||
import { notFound } from 'next/navigation';
|
||
import { routing } from '@/i18n/routing';
|
||
import { Marcellus } from 'next/font/google';
|
||
import '../globals.css';
|
||
|
||
const marcellus = Marcellus({
|
||
subsets: ['latin'],
|
||
variable: '--font-marcellus',
|
||
weight: ['400'],
|
||
});
|
||
|
||
export const metadata = {
|
||
title: 'Kozmos Beach & More',
|
||
description: 'Denizin Ormana Kıyısında — Akyaka, Gökova',
|
||
};
|
||
|
||
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();
|
||
}
|
||
|
||
const messages = await getMessages();
|
||
|
||
return (
|
||
<html lang={locale} data-scroll-behavior="smooth" className={`${marcellus.variable}`}>
|
||
<body className="bg-sand text-midnight font-body antialiased relative">
|
||
<NextIntlClientProvider messages={messages}>
|
||
{children}
|
||
</NextIntlClientProvider>
|
||
</body>
|
||
</html>
|
||
);
|
||
}
|