{guide.name}
+diff --git a/app/admin/[character]/[page]/page.tsx b/app/admin/[character]/[page]/page.tsx index 6713c9f..1e0b385 100644 --- a/app/admin/[character]/[page]/page.tsx +++ b/app/admin/[character]/[page]/page.tsx @@ -10,9 +10,9 @@ import { AdminHeader } from "@/components/admin/admin-header"; import { EditorPresence } from "@/components/admin/editor-presence"; import { Button } from "@/components/ui/button"; import { getAdminSession } from "@/lib/auth/server"; +import { getCachedCatalogOptions } from "@/lib/cache/catalog"; import { toTeamDraft } from "@/lib/guides/team-draft"; import { - getCatalogOptions, getAdminGuideContent, getGuideEditorHeader, } from "@/lib/guides/queries"; @@ -54,7 +54,7 @@ export default async function StructuredEditorPage({ ?? guide.sections.find((section) => section.slug === page)?.title ?? page; const [catalog, content] = await Promise.all([ - getCatalogOptions(), + getCachedCatalogOptions(), getAdminGuideContent(guide.slug, page), ]); if (!catalog || !content) notFound(); diff --git a/app/admin/[character]/comment/page.tsx b/app/admin/[character]/comment/page.tsx new file mode 100644 index 0000000..7b95143 --- /dev/null +++ b/app/admin/[character]/comment/page.tsx @@ -0,0 +1,57 @@ +import { Suspense } from "react"; +import Link from "next/link"; +import { ArrowLeftIcon } from "lucide-react"; +import { notFound, redirect } from "next/navigation"; +import { connection } from "next/server"; + +import { AdminHeader } from "@/components/admin/admin-header"; +import { GuideSectionNav } from "@/components/admin/guide-section-nav"; +import { CommentBoardContent } from "@/components/comments/comment-board-content"; +import { CommentBoardSkeleton } from "@/components/comments/comment-skeleton"; +import { Button } from "@/components/ui/button"; +import Image from "@/components/ui/resilient-image"; +import { getAdminSession } from "@/lib/auth/server"; +import { getGuideEditorHeader } from "@/lib/guides/queries"; + +export const instant = false; + +export default async function GuideCommentPage({ + params, +}: { + params: Promise<{ character: string }>; +}) { + await connection(); + if (!(await getAdminSession())) redirect("/auth/login?next=%2Fadmin"); + const { character } = await params; + const guide = await getGuideEditorHeader(character); + if (!guide) notFound(); + const extras = guide.sections + .filter((section) => section.kind === "extra") + .map(({ id, slug, title }) => ({ id, slug, title })); + + return ( +
{guide.name}
+ตอบกลับและจัดการความคิดเห็นจากทุกไกด์
Reply to and manage comments from every guide
Stygian Onslaught