67 lines
2.0 KiB
TypeScript
67 lines
2.0 KiB
TypeScript
import type { Metadata } from "next";
|
|
import { Geist, Geist_Mono } 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 { Header } from "@/components/layout/Header";
|
|
import { Footer } from "@/components/layout/Footer";
|
|
import "../globals.css";
|
|
|
|
const geistSans = Geist({
|
|
variable: "--font-geist-sans",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
const geistMono = Geist_Mono({
|
|
variable: "--font-geist-mono",
|
|
subsets: ["latin"],
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: "Teras Steakhouse | Inspired by Open Fire",
|
|
description: "Premium steakhouse experience with dry aged meat, argentine grill and fine wines.",
|
|
};
|
|
|
|
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={`dark ${geistSans.variable} ${geistMono.variable} h-full antialiased`}
|
|
data-scroll-behavior="smooth"
|
|
>
|
|
<head>
|
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..900;1,400..900&family=Inter:wght@100..900&family=Montserrat:wght@100..900&family=Material+Symbols+Outlined:wght,FILL@100..700,0..1&display=swap" />
|
|
</head>
|
|
<body className="min-h-full flex flex-col bg-background text-foreground" suppressHydrationWarning>
|
|
<NextIntlClientProvider messages={messages}>
|
|
<Header />
|
|
<main className="flex-1">
|
|
{children}
|
|
</main>
|
|
<Footer />
|
|
</NextIntlClientProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|