29 lines
1012 B
TypeScript
29 lines
1012 B
TypeScript
import { redirect } from "next/navigation";
|
|
import { connection } from "next/server";
|
|
|
|
import { WeaponImageGenerator } from "@/components/admin/weapon-image-generator";
|
|
import { getActiveCatalog } from "@/lib/guides/queries";
|
|
|
|
export default async function WeaponImagePage() {
|
|
await connection();
|
|
|
|
const catalog = await getActiveCatalog();
|
|
if (!catalog) redirect("/admin?sync=required");
|
|
|
|
return (
|
|
<div className="flex flex-col gap-8">
|
|
<header>
|
|
<p className="text-sm font-medium text-primary">Image generator</p>
|
|
<h1 className="font-heading text-3xl font-semibold">สร้างภาพ Weapon</h1>
|
|
<p className="mt-2 text-muted-foreground">
|
|
สร้างภาพเปรียบเทียบอาวุธจาก Catalog โดยไม่บันทึกข้อมูลลง Guide
|
|
</p>
|
|
</header>
|
|
<WeaponImageGenerator
|
|
characters={catalog.characters}
|
|
weapons={catalog.weapons}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|