fix(admin): repair layout and character artwork
This commit is contained in:
@@ -1,37 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import { connection } from "next/server";
|
||||
|
||||
import { AdminSidebar } from "@/components/admin/admin-sidebar";
|
||||
import { LiveRefresh } from "@/components/live-refresh";
|
||||
import { TemplateGallery } from "@/components/admin/template-gallery";
|
||||
import { SidebarInset, SidebarProvider, SidebarTrigger } from "@/components/ui/sidebar";
|
||||
import { getAdminSession } from "@/lib/auth/server";
|
||||
import { loadAdminNavigation } from "@/lib/content/loaders";
|
||||
import { builtInTemplates } from "@/lib/templates";
|
||||
|
||||
export default async function TemplatesPage() {
|
||||
await connection();
|
||||
if (!(await getAdminSession())) redirect("/admin/login");
|
||||
const navigation = await loadAdminNavigation();
|
||||
|
||||
return (
|
||||
<SidebarProvider>
|
||||
{process.env.BUZZ_DEMO_MODE === "true" ? null : (
|
||||
<LiveRefresh endpoint="/api/events/admin" />
|
||||
)}
|
||||
<AdminSidebar navigation={navigation} />
|
||||
<SidebarInset>
|
||||
<header className="flex min-h-14 items-center gap-3 border-b px-4">
|
||||
<SidebarTrigger />
|
||||
<div>
|
||||
<h1 className="font-heading font-semibold">เทมเพลตคู่มือ</h1>
|
||||
<p className="text-xs text-muted-foreground">โครงสร้างเริ่มต้นที่คัดมาจากรูปแบบคู่มือทั้งห้า</p>
|
||||
</div>
|
||||
</header>
|
||||
<main className="mx-auto w-full max-w-6xl p-4 sm:p-6 lg:p-8">
|
||||
<TemplateGallery templates={builtInTemplates} />
|
||||
</main>
|
||||
</SidebarInset>
|
||||
</SidebarProvider>
|
||||
);
|
||||
redirect("/admin/create");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user