import type { Viewport } from "next";
import { Cairo } from "next/font/google";
import { redirect } from "next/navigation";
import { needsSetup } from "@/lib/setup";
import "../globals.css";

const cairo = Cairo({
  subsets: ["arabic", "latin"],
  variable: "--font-cairo",
});

export const viewport: Viewport = {
  width: "device-width",
  initialScale: 1,
  themeColor: "#120c07",
  viewportFit: "cover",
};

export default async function ShopLayout({ children }: { children: React.ReactNode }) {
  if (await needsSetup()) redirect("/setup");
  return (
    <html lang="ar" className={`${cairo.variable} h-full`}>
      <body className="min-h-full font-sans antialiased">{children}</body>
    </html>
  );
}
