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

export const metadata: Metadata = {
  title: "Enterprise ERP Software | SYS AI Business Solutions",
  description: "Transform enterprise operations with SYS AI's comprehensive ERP platform. Streamline workflows, optimize resources, and drive growth.",
  keywords: "ERP software, enterprise resource planning, business management system, workflow automation, cloud ERP",
  metadataBase: new URL("https://sys-ai.erp"),
  alternates: {
    canonical: "https://sys-ai.erp",
  },
  openGraph: {
    title: "Enterprise ERP Software | SYS AI",
    description: "Comprehensive business management platform for enterprises",
    url: "https://sys-ai.erp",
    siteName: "SYS AI",
    type: "website",
    images: [
      {
        url: "https://sys-ai.erp/og-image.jpg",
        alt: "Enterprise ERP Dashboard",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Enterprise ERP Software | SYS AI",
    description: "Transform your business with intelligent enterprise resource planning",
    images: ["https://sys-ai.erp/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} ${mulish.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}