import type { Metadata } from "next";
import localFont from "next/font/local";
import { Toaster } from "@/components/ui/toaster";
import { createMetadata, translationServiceSchema } from "@/lib/metadata";
import { GoogleAnalytics } from "@/components/analytics/GoogleAnalytics";
import { env } from "@/lib/env";
import "./globals.css";

const geistSans = localFont({
  src: "./fonts/GeistVF.woff",
  variable: "--font-geist-sans",
  weight: "100 900",
});
const geistMono = localFont({
  src: "./fonts/GeistMonoVF.woff",
  variable: "--font-geist-mono",
  weight: "100 900",
});

export const metadata: Metadata = createMetadata(
  "TransLynx - Professional AI Translation Services Singapore",
  "Get instant document translation in 100+ languages. Certified translations for PR, business, legal documents. AI-powered accuracy with human review. Fast, affordable, trusted by thousands in Singapore.",
  []
);

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <html lang="en">
      <head>
        <script
          type="application/ld+json"
          dangerouslySetInnerHTML={{
            __html: JSON.stringify(translationServiceSchema),
          }}
        />
      </head>
      <body
        className={`${geistSans.variable} ${geistMono.variable} antialiased`}
      >
        <GoogleAnalytics measurementId={env.GA_MEASUREMENT_ID} />
        {children}
        <Toaster />
      </body>
    </html>
  );
}
