import type { Metadata } from "next"; import localFont from "next/font/local"; import { Suspense } from "react"; import MobileBottomNav from "@/components/MobileBottomNav"; import Navbar from "@/components/Navbar"; import Footer from "@/components/Footer"; import Providers from "@/components/providers"; import RouteProgress from "@/components/RouteProgress"; import { getCmsSiteContent } from "@/lib/content-cms"; import { siteUrl } from "@/lib/site"; import "../index.css"; const vazirmatn = localFont({ src: "./fonts/Vazirmatn-variable.woff2", display: "swap", weight: "100 900", variable: "--font-vazirmatn", fallback: ["Tahoma", "Arial", "sans-serif"], }); export async function generateMetadata(): Promise { const siteContent = await getCmsSiteContent(); const title = siteContent.seo.title || siteContent.official_name; const description = siteContent.seo.description || siteContent.description; const image = siteContent.seo.image?.url || siteContent.logo?.url || `${siteUrl}/favicon.ico`; return { metadataBase: new URL(siteUrl), title: { default: title, template: `%s | ${siteContent.short_name || siteContent.official_name}`, }, description, openGraph: { siteName: siteContent.official_name, images: [image], locale: "fa_IR", type: "website", }, }; } export default async function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { const siteContent = await getCmsSiteContent(); return ( رفتن به محتوای اصلی
{children}