68 lines
2.1 KiB
TypeScript
68 lines
2.1 KiB
TypeScript
import type { Metadata } from 'next';
|
|
import { PT_Sans } from 'next/font/google';
|
|
import '../globals.css'; // Adjusted path for globals.css
|
|
import { Toaster } from "@/components/ui/toaster";
|
|
import Header from '@/components/layout/Header';
|
|
import Footer from '@/components/layout/Footer';
|
|
import { cn } from '@/lib/utils';
|
|
import { ThemeProvider } from '@/components/theme-provider';
|
|
import { I18nProviderClient } from '@/locales/client';
|
|
import { getStaticParams } from '@/locales/server';
|
|
|
|
const ptSans = PT_Sans({
|
|
subsets: ['latin'],
|
|
weight: ['400', '700'],
|
|
variable: '--font-body',
|
|
});
|
|
|
|
export const metadata: Metadata = {
|
|
title: 'ToyShare - Share and Rent Toys',
|
|
description: 'A friendly platform to share and rent toys in your community.',
|
|
icons: {
|
|
icon: '/favicon.ico',
|
|
}
|
|
};
|
|
|
|
// Needed for static generation with dynamic [locale] segment
|
|
export function generateStaticParams() {
|
|
return getStaticParams();
|
|
}
|
|
|
|
export default function RootLayout({
|
|
children,
|
|
params: { locale }
|
|
}: Readonly<{
|
|
children: React.ReactNode;
|
|
params: { locale: string };
|
|
}>) {
|
|
return (
|
|
<I18nProviderClient locale={locale}>
|
|
<html lang={locale} suppressHydrationWarning>
|
|
<head>
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
|
|
<link href="https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap" rel="stylesheet" />
|
|
</head>
|
|
<body
|
|
className={cn('min-h-screen bg-background font-body antialiased flex flex-col', ptSans.variable)}
|
|
suppressHydrationWarning={true}
|
|
>
|
|
<ThemeProvider
|
|
attribute="class"
|
|
defaultTheme="system"
|
|
enableSystem
|
|
disableTransitionOnChange
|
|
>
|
|
<Header />
|
|
<main className="flex-grow container mx-auto px-4 py-8">
|
|
{children}
|
|
</main>
|
|
<Footer />
|
|
<Toaster />
|
|
</ThemeProvider>
|
|
</body>
|
|
</html>
|
|
</I18nProviderClient>
|
|
);
|
|
}
|