feat : add stygian guide
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { connection } from "next/server";
|
||||
|
||||
import { SiteFooter } from "@/components/public/site-footer";
|
||||
import { SiteHeader } from "@/components/public/site-header";
|
||||
import { StygianGuide } from "@/components/public/stygian-guide";
|
||||
import { LiveRefresh } from "@/components/live-refresh";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { getCachedActiveStygianSchedule } from "@/lib/cache/stygian";
|
||||
import { getActiveCatalog } from "@/lib/guides/queries";
|
||||
|
||||
export const instant = false;
|
||||
|
||||
export default async function StygianPage() {
|
||||
await connection();
|
||||
const [schedule, catalog] = await Promise.all([getCachedActiveStygianSchedule(), getActiveCatalog()]);
|
||||
return (
|
||||
<div className="flex min-h-svh flex-col bg-background">
|
||||
<LiveRefresh endpoint="/api/events/stygian" />
|
||||
<SiteHeader editHref="/admin/stygian" />
|
||||
<main className="mx-auto flex w-full max-w-7xl flex-1 flex-col gap-8 px-4 py-10 sm:px-6 sm:py-14">
|
||||
<header>
|
||||
<p className="text-sm font-medium text-primary">Stygian Onslaught</p>
|
||||
<h1 className="font-heading text-4xl font-semibold">Stygian Guide</h1>
|
||||
{schedule ? <p className="mt-2 text-muted-foreground">Version {schedule.challengeName} · Schedule {schedule.scheduleId}</p> : null}
|
||||
</header>
|
||||
{schedule && catalog ? <StygianGuide schedule={schedule} catalog={catalog} /> : (
|
||||
<Empty className="border"><EmptyHeader><EmptyTitle>Stygian Guide is not published yet</EmptyTitle><EmptyDescription>An administrator must sync and activate a schedule first.</EmptyDescription></EmptyHeader></Empty>
|
||||
)}
|
||||
</main>
|
||||
<SiteFooter />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user