74 lines
2.1 KiB
TypeScript
74 lines
2.1 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Inter, Montserrat } from "next/font/google";
|
|
import { NextIntlClientProvider } from 'next-intl';
|
|
import { getMessages, setRequestLocale } from 'next-intl/server';
|
|
import { notFound } from 'next/navigation';
|
|
import { routing } from '@/i18n/routing';
|
|
import { Navbar } from '@/components/navbar';
|
|
import { Footer } from '@/components/footer';
|
|
import { ThemeProvider } from "@/components/theme-provider";
|
|
import { Toaster } from "sonner";
|
|
import "../globals.css";
|
|
|
|
const inter = Inter({
|
|
variable: "--font-inter",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
const montserrat = Montserrat({
|
|
variable: "--font-montserrat",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Kordon Apart - Fethiye",
|
|
description: "Kordon Apart Fethiye / Merkez - Delüks ve Premium Apart Odalar",
|
|
};
|
|
|
|
export function generateStaticParams() {
|
|
return routing.locales.map((locale) => ({locale}));
|
|
}
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
params
|
|
}: Readonly<{
|
|
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={`${inter.variable} ${montserrat.variable} h-full antialiased`}
|
|
suppressHydrationWarning
|
|
>
|
|
<body className="min-h-full flex flex-col bg-surface dark:bg-inverse-surface text-on-surface dark:text-inverse-on-surface transition-colors duration-300" suppressHydrationWarning>
|
|
<ThemeProvider
|
|
attribute="class"
|
|
defaultTheme="system"
|
|
enableSystem
|
|
disableTransitionOnChange={false}
|
|
>
|
|
<NextIntlClientProvider messages={messages}>
|
|
<Navbar />
|
|
<main className="flex-1">
|
|
{children}
|
|
</main>
|
|
<Footer />
|
|
<Toaster position="bottom-right" richColors theme="system" />
|
|
</NextIntlClientProvider>
|
|
</ThemeProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|