import type { Metadata } from "next";
import { Halant } from "next/font/google";
import { Inter } from "next/font/google";
import { Libre_Baskerville } 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 libreBaskerville = Libre_Baskerville({
  variable: "--font-libre-baskerville",
  subsets: ["latin"],
  weight: ["400", "700"],
});

export const metadata: Metadata = {
  title: "Knock Games - Discover & Download Android Games",
  description: "Browse 50,000+ Android games from the Play Store. Find action, puzzle, strategy, casual games and more. Download games instantly with honest reviews and ratings.",
  keywords: "Android games, Play Store games, mobile games, game discovery, free games, game reviews",
  metadataBase: new URL("https://knockgames.com"),
  alternates: {
    canonical: "https://knockgames.com",
  },
  openGraph: {
    title: "Knock Games - Discover Amazing Android Games",
    description: "Your ultimate destination for discovering and downloading Android games from the Play Store.",
    url: "https://knockgames.com",
    siteName: "Knock Games",
    type: "website",
    images: [
      {
        url: "http://img.b2bpic.net/free-vector/hand-drawn-mobile-app-concept_23-2148119484.jpg",
        alt: "Knock Games - Android Games Discovery Platform",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Knock Games - Discover Amazing Android Games",
    description: "Your ultimate destination for discovering and downloading Android games from the Play Store.",
    images: ["http://img.b2bpic.net/free-vector/hand-drawn-mobile-app-concept_23-2148119484.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} ${libreBaskerville.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}