import type { Metadata } from "next";
import Script from "next/script";
import "./globals.css";

export const metadata: Metadata = {
  title: "Ayris Tech — Demo",
  description: "Ayris Tech tarafından hazırlanan demo sayfaları",
};

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="tr" className="antialiased">
      <head>
        <Script id="perf-measure-patch" strategy="beforeInteractive">
          {`
            (function() {
              if (typeof window !== 'undefined' && window.performance && window.performance.measure) {
                var _measure = window.performance.measure;
                window.performance.measure = function() {
                  try {
                    return _measure.apply(window.performance, arguments);
                  } catch (e) {
                    // Silently catch native timing measurement exceptions (e.g. negative timestamps or missing marks)
                  }
                };
              }
            })();
          `}
        </Script>
      </head>
      <body className="font-sans">{children}</body>
    </html>
  );
}
