import "./globals.css";

import type { Viewport } from "next";
import { I18nProvider } from "@/lib/i18n";
import { ServiceWorkerRegistrar } from "@/components/sw-registrar";

export const viewport: Viewport = {
  themeColor: "#2563EB",
  width: "device-width",
  initialScale: 1,
  maximumScale: 1,
  userScalable: false,
};

export const metadata = {
  title: "Notify",
  description: "简洁提醒应用",
  icons: {
    icon: "/icon.png",
    apple: "/icons/icon-192x192.png",
  },
  appleWebApp: {
    capable: true,
    statusBarStyle: "default",
    title: "Notify",
  },
  formatDetection: {
    telephone: false,
  },
};

const RootLayout = ({ children }: { children: React.ReactNode }) => {
  return (
    <html lang="zh" suppressHydrationWarning>
      <head>
        <link
          rel="apple-touch-startup-image"
          href="/icons/icon-512x512.png"
        />
      </head>
      <body className="min-h-screen bg-background font-sans antialiased">
        <I18nProvider>{children}</I18nProvider>
        <ServiceWorkerRegistrar />
      </body>
    </html>
  );
};

export default RootLayout;
