import type { Metadata } from "next";
import { Halant } from "next/font/google";
import { Inter } from "next/font/google";
import { Poppins } 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 poppins = Poppins({
  variable: "--font-poppins",
  subsets: ["latin"],
  weight: ["100", "200", "300", "400", "500", "600", "700", "800", "900"],
});

export const metadata: Metadata = {
  title: "ANLY - Professional Website Templates for Designers & Agencies",
  description: "Browse 50+ professional website templates designed for freelancers, agencies, and small businesses. Choose template + service level, customize, and launch in minutes.",
  keywords: "website templates, portfolio templates, business website, agency templates, professional templates, customizable templates, website builder",
  metadataBase: new URL("https://www.anly.io"),
  alternates: {
    canonical: "https://www.anly.io",
  },
  openGraph: {
    title: "ANLY - Professional Website Templates",
    description: "Launch your professional website in minutes with ANLY templates",
    url: "https://www.anly.io",
    siteName: "ANLY",
    type: "website",
    images: [
      {
        url: "http://img.b2bpic.net/free-vector/business-landing-page-with-photo_23-2148248047.jpg",
        alt: "ANLY Template Showcase",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "ANLY - Professional Website Templates",
    description: "Launch your professional website in minutes",
    images: ["http://img.b2bpic.net/free-vector/business-landing-page-with-photo_23-2148293486.jpg"],
  },
};

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