+
+
diff --git a/app/admin/page.tsx b/app/admin/page.tsx
index bcd74fa..6e8103e 100644
--- a/app/admin/page.tsx
+++ b/app/admin/page.tsx
@@ -2,6 +2,7 @@ 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 { getActiveCatalog, getLatestCatalogSyncJob, listGuideCards } from "@/lib/guides/queries";
@@ -15,9 +16,16 @@ export default async function AdminPage() {
getActiveCatalog(),
]);
return (
-
-
-
-
+
);
}
diff --git a/app/admin/templates/page.tsx b/app/admin/templates/page.tsx
index a093700..9a370c3 100644
--- a/app/admin/templates/page.tsx
+++ b/app/admin/templates/page.tsx
@@ -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 (
-
- {process.env.BUZZ_DEMO_MODE === "true" ? null : (
-
- )}
-
-
-
-
-
-
-
-
- );
+ redirect("/admin/create");
}
diff --git a/components/admin/admin-header.tsx b/components/admin/admin-header.tsx
new file mode 100644
index 0000000..3ce5f87
--- /dev/null
+++ b/components/admin/admin-header.tsx
@@ -0,0 +1,81 @@
+"use client";
+
+import Link from "next/link";
+import { usePathname, useRouter } from "next/navigation";
+import {
+ BookOpenIcon,
+ ExternalLinkIcon,
+ LayoutDashboardIcon,
+ LogOutIcon,
+ PlusIcon,
+} from "lucide-react";
+
+import { Button } from "@/components/ui/button";
+import { authClient } from "@/lib/auth/client";
+
+export function AdminHeader() {
+ const pathname = usePathname();
+ const router = useRouter();
+
+ return (
+
+
+
+
+
+
+
Buzz Sheet Admin
+
+
+
+
+ );
+}
diff --git a/components/admin/guide-section-editor.tsx b/components/admin/guide-section-editor.tsx
index d099b0d..23dafe2 100644
--- a/components/admin/guide-section-editor.tsx
+++ b/components/admin/guide-section-editor.tsx
@@ -87,7 +87,7 @@ export function GuideSectionEditor(props: GuideSectionEditorProps) {
{props.section === "constellations" ?
: null}
{props.section === "team" ?
: null}
{props.section === "extra" ?
: null}
-
{index > 0 ? : Overview}{SECTION_LABELS[props.section]}{index < SECTION_ORDER.length - 1 ? : null}
+
{index > 0 ? : Overview}{SECTION_LABELS[props.section]}{index < SECTION_ORDER.length - 1 ? : null}
);
}
diff --git a/components/admin/media-uploader.tsx b/components/admin/media-uploader.tsx
index 9feed6c..00b02e3 100644
--- a/components/admin/media-uploader.tsx
+++ b/components/admin/media-uploader.tsx
@@ -74,6 +74,7 @@ export function MediaUploader({
className="w-full"
disabled={busy}
render={
}
+ nativeButton={false}
>
{busy ?
:
}
{state === "uploading" && "กำลังอัปโหลด…"}
diff --git a/components/public/site-header.tsx b/components/public/site-header.tsx
index 8d5bc55..d8a4bb7 100644
--- a/components/public/site-header.tsx
+++ b/components/public/site-header.tsx
@@ -21,7 +21,7 @@ export function SiteHeader() {
-
}>
+
}>
จัดการเนื้อหา
diff --git a/lib/catalog/sync.ts b/lib/catalog/sync.ts
index 63f83f2..f6c209f 100644
--- a/lib/catalog/sync.ts
+++ b/lib/catalog/sync.ts
@@ -20,7 +20,7 @@ const versionSchema = z.object({
});
const characterSchema = z.record(z.string(), z.object({
enName: z.string(),
- CardImg: z.string(),
+ GachaImg: z.string(),
element: z.string().optional(),
qualityType: z.string().optional(),
weaponType: z.string().optional(),
@@ -98,10 +98,10 @@ export async function processCatalogSyncJob(jobId: string): Promise
{
const weaponData = weaponSchema.parse(weaponsRaw);
const artifactData = artifactSchema.parse(artifactsRaw);
- let characters = Object.entries(characterData).filter(([, value]) => value.enName && value.enName !== "???" && value.CardImg).map(([key, value]) => ({
+ let characters = Object.entries(characterData).filter(([, value]) => value.enName && value.enName !== "???" && value.GachaImg).map(([key, value]) => ({
version, key, name: value.enName, element: value.element ?? null, rarity: rarity(value.qualityType), weaponType: value.weaponType ?? null,
- imageKey: `catalog/${version}/characters/${webpName(value.CardImg)}`,
- sourceImage: `${API_ROOT}/assets/gachaicon/${encodeURIComponent(webpName(value.CardImg))}`,
+ imageKey: `catalog/${version}/characters/${webpName(value.GachaImg)}`,
+ sourceImage: `${API_ROOT}/assets/gachaimg/${encodeURIComponent(webpName(value.GachaImg))}`,
}));
let weapons = Object.entries(weaponData).filter(([, value]) => value.enName && value.enName !== "???" && value.weaponIcon).map(([key, value]) => ({
version, key, name: value.enName, rarity: rarity(value.qualityType), weaponType: value.weaponType ?? null,