import type { Metadata, Viewport } from "next";
import { NextIntlClientProvider } from "next-intl";
import localFont from "next/font/local";
import faMessages from "../../../messages/fa.json";
import { MeeziToaster } from "@/components/ui/meezi-toaster";
import "../globals.css";

export const metadata: Metadata = {
  title: "منوی کافه — میزی",
  description: "مشاهده منو و ثبت سفارش از میز",
  manifest: "/manifest.webmanifest",
  icons: {
    icon: [
      { url: "/icons/icon-32.png", sizes: "32x32", type: "image/png" },
      { url: "/icons/icon-192.png", sizes: "192x192", type: "image/png" },
    ],
    apple: "/icons/icon-180.png",
  },
  robots: { index: false, follow: false },
};

export const viewport: Viewport = {
  themeColor: "#0F6E56",
  width: "device-width",
  initialScale: 1,
};

const vazirmatn = localFont({
  src: "../../fonts/Vazirmatn-Variable.woff2",
  variable: "--font-vazirmatn",
  display: "swap",
  weight: "100 900",
});

export default function QrRootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="fa" dir="rtl">
      <body
        className={`${vazirmatn.variable} min-h-svh bg-transparent font-sans antialiased font-[family-name:var(--font-vazirmatn)]`}
      >
        <NextIntlClientProvider locale="fa" messages={faMessages}>
          {children}
          <MeeziToaster />
        </NextIntlClientProvider>
      </body>
    </html>
  );
}
