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

export const metadata: Metadata = {
  title: "Milestones Technologies | Industrial Automation & Engineering Solutions Thailand",
  description: "Thailand-based industrial automation, robot & cobot solutions, packaging machinery, smart gates, and custom engineering for factories, warehouses & businesses.",
  keywords: "industrial automation Thailand, robotics, cobot, packaging machinery, smart gate systems, factory automation, manufacturing solutions, engineering services",
  metadataBase: new URL("https://milestones-technologies.co.th"),
  alternates: {
    canonical: "https://milestones-technologies.co.th",
  },
  openGraph: {
    title: "Milestones Technologies - Automation Solutions for Industry & Smart Living",
    description: "Premium industrial automation, robotic systems, smart gates, and engineering services from Thailand's trusted automation leader.",
    url: "https://milestones-technologies.co.th",
    siteName: "Milestones Technologies",
    type: "website",
    images: [
      {
        url: "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3BC5DoKtnbMRErIYJgmPK5zjs5w/industrial-robot-arm-performing-precise--1773981130354-3aca37a1.png",
        alt: "Industrial automation solutions",
      },
    ],
  },
  twitter: {
    card: "summary_large_image",
    title: "Milestones Technologies - Industrial Automation Solutions",
    description: "Transform your factory with cutting-edge automation, robotics, and engineering solutions.",
    images: [
      "https://webuild-dev.s3.eu-north-1.amazonaws.com/users/user_3BC5DoKtnbMRErIYJgmPK5zjs5w/industrial-robot-arm-performing-precise--1773981130354-3aca37a1.png",
    ],
  },
  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} ${lato.variable} antialiased`}
        >
          <Tag />
          {children}
          <script
              dangerouslySetInnerHTML={{
                  __html: `${getVisualEditScript()}`
          }}
        />
        </body>
      </ServiceWrapper>
    </html>
  );
}