Remove the per-route 'export const instant = false' opt-outs now that the root layout carries the single Cache Components opt-out. Child pages inherit the opt-out, so admin/mod/radio leaf pages that only access cached or DB data stay instant while runtime-dependent pages remain dynamic. Update the staff-smoke contract test to assert the root-layout contract.
17 lines
440 B
TypeScript
17 lines
440 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { AdminMediaGrid } from "@/components/admin/media-grid";
|
|
import { canAccess, getAdminContext, PERMS } from "@/lib/permissions";
|
|
|
|
export default async function AdminMediaPage() {
|
|
const { session, permissions } = await getAdminContext();
|
|
if (!canAccess(permissions, PERMS.PAGES_VIEW, session.user.rank)) {
|
|
redirect("/admin");
|
|
}
|
|
|
|
return (
|
|
<main>
|
|
<AdminMediaGrid />
|
|
</main>
|
|
);
|
|
}
|