feat : add monthly
This commit is contained in:
@@ -12,17 +12,35 @@ import { getActiveCatalog, listGuideCards } from "@/lib/guides/queries";
|
||||
export default async function CreateGuidePage() {
|
||||
await connection();
|
||||
if (!(await getAdminSession())) redirect("/auth/login?next=%2Fadmin");
|
||||
const [catalog, guides] = await Promise.all([getActiveCatalog(), listGuideCards()]);
|
||||
const [catalog, guides] = await Promise.all([
|
||||
getActiveCatalog(),
|
||||
listGuideCards(),
|
||||
]);
|
||||
if (!catalog) redirect("/admin?sync=required");
|
||||
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 className="flex items-center gap-4">
|
||||
<Button variant="ghost" size="icon" render={<Link href="/admin" />} nativeButton={false} aria-label="กลับ Dashboard"><ArrowLeftIcon /></Button>
|
||||
<div><p className="text-sm text-muted-foreground">Catalog ล่าสุดจาก Lunaris</p><h1 className="font-heading text-3xl font-semibold">สร้าง Guide ใหม่</h1></div>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
render={<Link href="/admin" />}
|
||||
nativeButton={false}
|
||||
aria-label="กลับ Dashboard"
|
||||
>
|
||||
<ArrowLeftIcon />
|
||||
</Button>
|
||||
<div>
|
||||
<h1 className="font-heading text-3xl font-semibold">
|
||||
สร้าง Guide ใหม่
|
||||
</h1>
|
||||
</div>
|
||||
</header>
|
||||
<CreateGuideFlow characters={catalog.characters} existingKeys={guides.map((guide) => guide.characterKey)} />
|
||||
<CreateGuideFlow
|
||||
characters={catalog.characters}
|
||||
existingKeys={guides.map((guide) => guide.characterKey)}
|
||||
/>
|
||||
</main>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user