import type { Metadata } from "next";
import { Halant } from "next/font/google";
import { Inter } from "next/font/google";
import { Manrope } from "next/font/google";
import "./globals.css";
import { ServiceWrapper } from "@/components/ServiceWrapper";
import Tag from "@/tag/Tag";
import { getVisualEditScript } from "@/utils/visual-edit-script";

const halant = Halant({
  variable: "--font-halant",
  subsets: ["latin"],
  weight: ["300", "400", "500", "600", "700"],
});

const inter = Inter({
  variable: "--font-inter",
  subsets: ["latin"],
});

const manrope = Manrope({
  variable: "--font-manrope",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "Uzum Market | Online Marketplace for Electronics, Fashion, Home & More",
  description: "Shop millions of products across Electronics, Fashion, Home Appliances, Food, and more on Uzum Market. Fast delivery, secure payments, and exclusive deals. Your trusted online marketplace in Central Asia.",
  keywords: "online marketplace, shopping, e-commerce, electronics, fashion, home appliances, food, Uzbekistan",
  metadataBase: new URL("https://uzummarket.com"),
  alternates: {
    canonical: "https://uzummarket.com",
  },
  openGraph: {
    title: "Uzum Market | Central Asia's Leading Online Marketplace",
    description: "Discover millions of products with fast delivery and secure payments. Shop electronics, fashion, home appliances, food, and more on Uzum Market.",
    url: "https://uzummarket.com",
    siteName: "Uzum Market",
    type: "website",
    images: [
      {
        url: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3BFXLk9BIVZ4EdOfJDPnXCjvU6t/a-vibrant-e-commerce-marketplace-hero-ba-1774085815694-d978e246.png",
        alt: "Uzum Market - Online Marketplace",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Uzum Market | Online Marketplace",
    description: "Shop millions of products with fast delivery. Electronics, Fashion, Home, Food & more.",
    images: [
      "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3BFXLk9BIVZ4EdOfJDPnXCjvU6t/a-vibrant-e-commerce-marketplace-hero-ba-1774085815694-d978e246.png",
    ],
  },
  robots: {
    index: true,
    follow: true,
  },
};

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en" suppressHydrationWarning>
      <ServiceWrapper>
        <body
          className={`${halant.variable} ${inter.variable} ${manrope.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}