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

const dmSans = DM_Sans({
  variable: "--font-dm-sans",
  subsets: ["latin"],
});

export const metadata: Metadata = {
  title: "Professional Service in Your Area | ProServices",
  description: "Reliable, affordable service for residential and commercial properties. Fast response times, free estimates, and expert service. Call (555) 123-4567 today.",
  keywords: "service, professional, local, reliable, affordable, quote",
  metadataBase: new URL("https://proservices.local/"),
  alternates: {
    canonical: "https://proservices.local/",
  },
  robots: {
    index: true,
    follow: true,
  },
  openGraph: {
    title: "Professional Service You Can Trust",
    description: "Fast, affordable, and done right the first time. Free estimates available.",
    type: "website",
    siteName: "ProServices",
    url: "https://proservices.local/",
    images: [
      {
        url: "https://proservices.local/og-home.jpg",
        alt: "Professional service team ready to serve",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Professional Service in Your Area",
    description: "Reliable, affordable service. Call for your free quote.",
    images: ["https://proservices.local/og-home.jpg"],
  },
};

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