import type { Metadata } from "next";
import { ReactNode } from "react";

import "../i18n/request";
import "./globals.css";

import { LanguageProvider } from "@/context/language-context";
import { Navbar } from "@/components/Navbar";
import { Footer } from "@/components/Footer";

export const metadata: Metadata = {
  title: {
    default: "Texnik Uskunalar | Nasoslar va Datchiklar",
    template: "%s | Texnik Uskunalar",
  },
  description:
    "Sanoat uchun mo‘ljallangan nasoslar, datchiklar va texnik qurilmalar. Zamonaviy 3D ko‘rinishda mahsulotlar katalogi.",
  keywords: [
    "nasos",
    "datchik",
    "texnik uskuna",
    "industrial equipment",
    "sensor",
    "pump",
  ],
  authors: [{ name: "Max Di Group" }],
  metadataBase: new URL("https://promtechno.uz/"),
  openGraph: {
    title: "Texnik Uskunalar",
    description:
      "Nasoslar va datchiklarni 3D ko‘rinishda ko‘ring va solishtiring",
    url: "https://promtechno.uz/",
    siteName: "Texnik Uskunalar",
    locale: "uz_UZ",
    type: "website",
    images: [
      {
        url: "/logo.jpg",
        width: 1200,
        height: 630,
        alt: "Texnik Uskunalar Logo",
      },
    ],
  },
};

// for github pages deployment

export default function RootLayout({ children }: { children: ReactNode }) {
  return (
    <html lang="uz" dir="ltr">
      <body className="flex min-h-screen flex-col">
        <LanguageProvider>
          <Navbar />
          <main className="flex-1">{children}</main>
          <Footer />
        </LanguageProvider>
      </body>
    </html>
  );
}
