import { Suspense } from "react";

import { AdminPermissionGate } from "@/components/admin/admin-permission-gate";
import { PRD_JACKPOT_ACCESS_ANY } from "@/lib/admin-prd";
import { JackpotConfigScreen } from "@/modules/jackpot/jackpot-config-screen";
import { RulesPageShell } from "@/modules/rules/rules-page-shell";
import { buildPageMetadata } from "@/lib/page-metadata";
import type { Metadata } from "next";

export const metadata: Metadata = buildPageMetadata("jackpot", "configTitle");

export default function AdminJackpotPage() {
  return (
    <RulesPageShell>
      <AdminPermissionGate requiredAny={PRD_JACKPOT_ACCESS_ANY}>
        <Suspense fallback={<p className="text-sm text-muted-foreground">Loading…</p>}>
          <JackpotConfigScreen />
        </Suspense>
      </AdminPermissionGate>
    </RulesPageShell>
  );
}
