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

export const metadata: Metadata = {
  title: "Free Store Optimization Checklist - E-commerce Audit Tool",
  description: "Get a comprehensive e-commerce audit in 60 seconds. Scan your store URL to find SEO, AI visibility, performance, and conversion issues affecting sales.",
  keywords: "e-commerce audit, store optimization, SEO checker, conversion optimization, ecommerce performance",
  robots: {
    index: true,
    follow: true,
  },
  openGraph: {
    title: "Free Store Optimization Checklist",
    description: "Discover critical issues affecting your e-commerce store's sales and visibility. Get actionable recommendations in minutes.",
    type: "website",
    siteName: "StoreAudit",
    images: [
      {
        url: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3B25Hs1BWiFe17Y6WtCSxZeJVX7/a-modern-technical-seo-audit-checklist-i-1773674306370-9558d1f4.png",
        alt: "Store optimization audit tool",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Free Store Optimization Audit",
    description: "Check if your e-commerce store is losing sales. Get a complete optimization report in 60 seconds.",
    images: [
      "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3B25Hs1BWiFe17Y6WtCSxZeJVX7/a-modern-technical-seo-audit-checklist-i-1773674306370-9558d1f4.png",
    ],
  },
};

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