import Image from "next/image"; import Link from "next/link"; import { ChevronLeftIcon, DownloadIcon } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { buttonVariants } from "@/components/ui/button"; import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Kbd } from "@/components/ui/kbd"; import { Separator } from "@/components/ui/separator"; import { SiteHeader } from "@/components/public/site-header"; import { LiveRefresh } from "@/components/live-refresh"; import { rarityGradientClass, rarityTextClass } from "@/lib/catalog/rarity"; import type { PublicGuide } from "@/lib/guides/queries"; import { cn } from "@/lib/utils"; function hasSection(guide: PublicGuide, slug: string): boolean { if (slug === "weapon") return guide.weapons.length > 0; if (slug === "artifact") return guide.artifactGroups.some((group) => group.rows.length > 0) || Boolean(guide.artifactProfile && (guide.artifactProfile.sands.length || guide.artifactProfile.goblet.length || guide.artifactProfile.circlet.length)); if (slug === "constellations") return guide.constellations.length > 0; if (slug === "team") return guide.teams.length > 0; return guide.extras.some((extra) => extra.slug === slug && extra.rows.length > 0); } export function publicSections(guide: PublicGuide) { return guide.sections.filter((section) => hasSection(guide, section.slug)); } export function StructuredGuideShell({ guide, section }: { guide: PublicGuide; section?: string }) { const sections = publicSections(guide); return
{guide.name}
Build Guide
Build Overview
{guide.overview}
อาวุธที่แนะนำ
{index + 1}. {row.weapon.name} R{row.refinement}
{metric(row.overallPercent)}
ดาเมททั้งทีม
{metric(row.personalPercent)}
ดาเมจส่วนตัว
อาร์ติแฟกต์และสเตตัสที่แนะนำ
{index + 1}. {row.first.name}{row.second ? ` + ${row.second.name}` : ""}
{metric(row.percent)}
Target Stats
{profile.targets.map((target) =>Talent Priority
{profile.note}
: null}{label}
กลุ่มดาว
{row.detail}
คำนวณความเสียหาย
C{member.constellation} {member.character.name}
{Number(member.damage).toLocaleString(undefined, { maximumFractionDigits: 2 })}
{total ? (Number(member.damage) / total * 100).toFixed(2) : "0.00"}%
Total damage
{total.toLocaleString()}
Total DPS
{seconds > 0 ? (total / seconds).toLocaleString(undefined, { maximumFractionDigits: 0 }) : "0"}
{team.combo}
Extra Guide