import { Suspense } from "react"; import config from "@payload-config"; import { headers as nextHeaders } from "next/headers"; import { getPayload } from "payload"; import { BookOpenIcon } from "lucide-react"; import { WikiIndex } from "@/components/frontend/wiki/WikiIndex"; import { mapWikiPageToEntry } from "@/lib/wiki/indexView"; import { canViewAllDrafts, draftVisibilityWhere } from "@/lib/wiki/service"; import { hasIntelligenceQualification } from "@/utils/access-control/hasIntelligenceQualification"; export const metadata = { title: "Wiki: Polaris Task Force", }; export default async function WikiPage() { const headers = await nextHeaders(); const payload = await getPayload({ config }); const { user } = await payload.auth({ headers, canSetHeaders: false, }); const canViewAll = await canViewAllDrafts(payload, user); const where = draftVisibilityWhere(user, canViewAll); const [pagesResult, isModerator] = await Promise.all([ payload.find({ collection: "wiki-pages", where: where ?? {}, sort: "-updatedAt", limit: 200, depth: 1, overrideAccess: true, }), hasIntelligenceQualification(payload, user), ]); const pages = pagesResult.docs.map(mapWikiPageToEntry); return (

Wiki

A shared field guide for campaigns, characters, places, and the stories around them.

); }