Files
kozmos-web/app/[locale]/layout.tsx
T
2026-06-03 03:59:46 +03:00

48 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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>
);
}