Files
buzz-sheet/app/admin/page.tsx
T
gunshiz e0794822b1
CI / Verify (push) Successful in 1m18s
CI / Build immutable images and deploy (push) Successful in 1m57s
feat(i18n) : add personal languages and compact weapon exports
2026-09-14 16:44:44 +07:00

35 lines
1.4 KiB
TypeScript

import { Text } from "@/components/i18n/text";
import { redirect } from "next/navigation";
import { connection } from "next/server";
import { StructuredDashboard } from "@/components/admin/structured-dashboard";
import { AdminHeader } from "@/components/admin/admin-header";
import { getAdminSession } from "@/lib/auth/server";
import { getCurrentCatalogVersion } from "@/lib/catalog/sync";
import { listGuideCards } from "@/lib/guides/queries";
export const instant = false;
export default async function AdminPage() {
await connection();
if (!(await getAdminSession())) redirect("/admin/login");
const [guides, trash, catalogVersion] = await Promise.all([
listGuideCards(),
listGuideCards(true),
getCurrentCatalogVersion(),
]);
return (
<div className="min-h-svh">
<AdminHeader />
<main className="mx-auto flex w-full max-w-7xl flex-col gap-8 p-4 sm:p-6 lg:p-8">
<header>
<p className="text-sm font-medium text-primary"><Text message="Content workspace" /></p>
<h1 className="font-heading text-3xl font-semibold"><Text message="Guide Dashboard" /></h1>
<p className="mt-2 text-muted-foreground"><Text message="จัดการ Guide แบบภาพ-first และบันทึกขึ้นเว็บไซต์ทันที" /></p>
</header>
<StructuredDashboard guides={guides} trash={trash} catalogVersion={catalogVersion} />
</main>
</div>
);
}