"use client"; import { useTranslation } from "@/components/i18n/locale-provider"; import Image from "next/image"; import Link from "next/link"; import type { MouseEvent } from "react"; import { AddExtraButton } from "@/components/admin/guide-extra-controls"; import { ScrollableNav } from "@/components/public/scrollable-nav"; import { navigationIconPath } from "@/lib/navigation"; import { cn } from "@/lib/utils"; const sections = [ { slug: "weapon", label: "Weapons" }, { slug: "artifact", label: "Artifacts & Stats" }, { slug: "constellations", label: "Constellations" }, { slug: "team", label: "Team Calc" }, ] as const; export function GuideSectionNav({ guideId, characterKey, current, extras, }: { guideId: string; characterKey: string; current: string; extras: Array<{ id: string; slug: string; title: string }>; }) { const { t } = useTranslation(); const confirmNavigation = (event: MouseEvent) => { const browserWindow = window as Window & { __guideHasUnsavedChanges?: boolean }; if (typeof window !== "undefined" && browserWindow.__guideHasUnsavedChanges && !window.confirm(t("ข้อมูลยังบันทึกไม่เสร็จหรือไม่ถูกต้อง ต้องการออกจากหน้านี้หรือไม่?"))) { event.preventDefault(); } }; return ( {t("Overview")} {sections.map((section) => { const iconPath = navigationIconPath(section.slug); return ( {iconPath ? : null} {t(section.label)} ); })} {extras.map((extra) => ( {extra.title} ))} ); }