import type { Metadata } from "next";
import { Halant } from "next/font/google";
import { Inter } from "next/font/google";
import { DM_Sans } 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 dmSans = DM_Sans({
  variable: "--font-dm-sans",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "N&H BAKERY - Premium Baked Goods & Custom Cakes | Nairobi",
  description: "Artisanal bakery in Nairobi offering premium cakes, pastries, bread & beverages. Custom wedding & birthday cakes. Fresh baked daily. Order online with free delivery.",
  keywords: "bakery, cakes, pastries, custom cakes, wedding cakes, birthday cakes, bread, Nairobi, Kenya",
  metadataBase: new URL("https://nhbakery.co.ke"),
  alternates: {
    canonical: "https://nhbakery.co.ke",
  },
  openGraph: {
    title: "N&H BAKERY - Premium Artisanal Baked Goods",
    description: "Freshly baked goodness. Custom cakes, pastries, and premium baked goods in Nairobi.",
    url: "https://nhbakery.co.ke",
    siteName: "N&H BAKERY",
    type: "website",
    images: [
      {
        url: "https://nhbakery.co.ke/og-image.jpg",
        alt: "N&H BAKERY Premium Baked Goods",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "N&H BAKERY - Freshly Baked Goodness",
    description: "Premium artisanal bakery in Nairobi. Custom cakes, pastries & more.",
    images: ["https://nhbakery.co.ke/twitter-image.jpg"],
  },
  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} ${dmSans.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}