Files
moygroup/app/[lang]/layout.tsx
T

81 lines
2.3 KiB
TypeScript

import type { Metadata } from "next";
import { Cormorant_Garamond, Montserrat } from "next/font/google";
import Navbar from "../components/Navbar";
import Footer from "../components/Footer";
import { MotionProvider } from "../components/MotionProvider";
import "../globals.css";
import { Locale, getDictionary } from "../dictionaries";
const cormorant = Cormorant_Garamond({
variable: "--font-cormorant",
subsets: ["latin"],
weight: ["300", "400", "500", "600", "700"],
});
const montserrat = Montserrat({
variable: "--font-montserrat",
subsets: ["latin"],
weight: ["300", "400", "500", "600", "700"],
});
export async function generateMetadata({ params }: { params: Promise<{ lang: string }> }): Promise<Metadata> {
const { lang } = await params;
const dict = await getDictionary(lang as Locale);
return {
metadataBase: new URL("https://moygroup.com.tr"),
title: {
template: "%s | Moy Group",
default: dict.seo.home.title,
},
description: dict.seo.home.description,
};
}
export default async function RootLayout({
children,
params,
}: Readonly<{
children: React.ReactNode;
params: Promise<{ lang: string }>;
}>) {
const { lang } = await params;
const locale = lang as Locale;
const dict = await getDictionary(locale);
const jsonLd = {
"@context": "https://schema.org",
"@type": "Organization",
"name": "Moy Group",
"url": "https://moygroup.com.tr",
"logo": "https://moygroup.com.tr/logo.png",
"contactPoint": {
"@type": "ContactPoint",
"telephone": "+90-534-465-62-35",
"contactType": "customer service"
}
};
return (
<html
lang={locale}
className={`${cormorant.variable} ${montserrat.variable} h-full antialiased`}
>
<head>
{/* VPS Panel Analytics */}
<script defer src="https://panel.ayris.tech/api/analytics/script" data-domain="moygroup.com.tr"></script>
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
/>
</head>
<body className="min-h-full flex flex-col">
<MotionProvider>
<Navbar lang={locale} dict={dict.navigation} />
<main className="flex-1">{children}</main>
<Footer lang={locale} dict={dict.footer} />
</MotionProvider>
</body>
</html>
);
}