import config from "@payload-config";
import { RootPage } from "@payloadcms/next/views";
import { Suspense } from "react";

// The Payload admin panel is fully dynamic (cookies/auth). Under
// `cacheComponents` we allow a blocking route and stream the panel
// inside Suspense so prerender discipline is satisfied.
export const instant = false;

import { importMap } from "../importMap.js";

type Args = {
  params: Promise<{ segments: string[] }>;
  searchParams: Promise<{ [key: string]: string | string[] }>;
};

const Page = ({ params, searchParams }: Args) =>
  RootPage({ config, importMap, params, searchParams });

export default Page;
