From 747c9229516ae39a13770e8035680a3d973625b7 Mon Sep 17 00:00:00 2001 From: gunshiz Date: Wed, 7 Oct 2026 15:15:53 +0700 Subject: [PATCH] feat : update --- components/public/public-navigation.tsx | 2 +- components/public/structured-guide.tsx | 121 +--------------------- components/public/weapon-display-mode.tsx | 6 +- 3 files changed, 8 insertions(+), 121 deletions(-) diff --git a/components/public/public-navigation.tsx b/components/public/public-navigation.tsx index f74cd83..1290f25 100644 --- a/components/public/public-navigation.tsx +++ b/components/public/public-navigation.tsx @@ -19,7 +19,7 @@ import { const destinations = [ { href: "/", label: "หน้ารวม", icon: null }, - { href: "/commission", label: "ขอคำนวณทีม", icon: "/icon/commission.webp" }, + { href: "/commission", label: "จ้างคำนวณทีม", icon: "/icon/commission.webp" }, { href: "/stygian", label: "ไกด์ Stygian", icon: "/icon/stygian.webp" }, ] as const; diff --git a/components/public/structured-guide.tsx b/components/public/structured-guide.tsx index 1c57249..9a137aa 100644 --- a/components/public/structured-guide.tsx +++ b/components/public/structured-guide.tsx @@ -55,9 +55,7 @@ import { import { normalizeTalentPriorities, talentRelationSymbol, - talentTypeLabel, } from "@/lib/guides/talents"; -import { comparisonDelta, comparisonReferenceNames } from "@/lib/guides/comparison"; import { parseYouTubeUrl } from "@/lib/guides/youtube"; import { normalizeExtraRichText } from "@/lib/rich-text"; import { @@ -224,7 +222,6 @@ function GuideOverview({ -
row ? { - name: row.weapon.name, refinement: row.refinement, note: row.note, - conditionName: weaponGroup?.name, conditionNote: weaponGroup?.note, - } : null; - const artifactGroup = guide.artifactGroups[0]; - const artifact = artifactGroup?.tiers.flatMap((tier) => tier.rows)[0]; - // Complete admin previews already contain this data; keep their reads unchanged. - const summary = guide.buildSummary ?? { - weapon: summarizeWeapon(weaponGroup?.rows[0]), - fourStarWeapon: summarizeWeapon(weaponGroup?.rows.find((row) => row.weapon.rarity === 4)), - artifact: artifact ? { - name: artifact.first.name, secondKey: artifact.secondArtifactKey, secondName: artifact.second?.name, - note: artifact.note, conditionName: artifactGroup?.name, conditionNote: artifactGroup?.note, - } : null, - profile: guide.artifactProfile, - }; - if (!summary || (!summary.weapon && !summary.artifact && !summary.profile)) return null; - const profile = summary.profile; - const recommended = profile?.recommendedConditions[0] ?? profile; - const target = profile?.targetConditions[0]; - const targets = target?.rows ?? profile?.targets ?? []; - const talents = normalizeTalentPriorities(profile?.talents ?? []); - return - - สรุปคำแนะนำในไกด์ - สรุปจากเงื่อนไขแรกของแต่ละหัวข้อ เปิดรายละเอียดเพื่อเลือกเงื่อนไขที่ตรงกับทีมของคุณ - - - {summary.weapon &&
-

อาวุธ

-

{summary.weapon.name} R{summary.weapon.refinement}

- {summary.fourStarWeapon &&

ตัวเลือก 4 ดาวในไกด์: {summary.fourStarWeapon.name} R{summary.fourStarWeapon.refinement}

} - {summary.weapon.conditionName && {summary.weapon.conditionName}} - {summary.weapon.conditionNote &&

{summary.weapon.conditionNote}

} - {summary.weapon.note &&

{summary.weapon.note}

} - เปรียบเทียบอาวุธทั้งหมด -
} - {summary.artifact &&
-

อาร์ติแฟกต์

-

{summary.artifact.secondKey ? `2 ${summary.artifact.name} + 2 ${summary.artifact.secondName ?? "ชุดที่สองตามไกด์"}` : `4 ${summary.artifact.name}`}

- {summary.artifact.conditionName && {summary.artifact.conditionName}} - {summary.artifact.conditionNote &&

{summary.artifact.conditionNote}

} - {summary.artifact.note &&

{summary.artifact.note}

} -
} - {recommended && [recommended.sands, recommended.goblet, recommended.circlet].some((values) => values.length) &&
-

ออฟหลัก

- {profile?.recommendedConditions[0]?.name && {profile.recommendedConditions[0].name}} - {profile?.recommendedConditions[0]?.note &&

{profile.recommendedConditions[0].note}

} -
- {([['นาฬิกา', recommended.sands], ['ถ้วย', recommended.goblet], ['หัว', recommended.circlet]] as const).map(([label, values]) => - values.length ?
{label}
{values.map((value) => statLabel(value)).join(" / ")}
: null)} -
-
} - {(targets.length > 0 || talents.length > 0) &&
- {targets.length > 0 && <> -

ค่าสถานะเป้าหมาย

- {target?.name && {target.name}} - {target?.note &&

{target.note}

} -
{targets.map((row, index) =>
{statLabel(row.stat)}
{row.value}
)}
- } - {talents.length > 0 && <>

ลำดับพรสวรรค์

{talents.map((talent, index) => {talentTypeLabel(talent.type)}{talent.level ? ` Lv.${talent.level}` : ""}{index < talents.length - 1 ? ` ${talentRelationSymbol(talent.relationToNext)} ` : ""})}

} - ดูค่าสถานะและเงื่อนไขทั้งหมด -
} -
-
; -} - function GuideNavigation({ guide, sections, @@ -501,9 +429,6 @@ function WeaponSectionContent({ ) : null}
-

- อาวุธที่แนะนำ -

- {exportLabel(exporting, "อาวุธ", "Weapons")} + อาวุธ

{note ? ( @@ -551,41 +476,11 @@ function WeaponSectionContent({ ) : null}
{group.note ?

{group.note}

: null} - {!exporting && - เปอร์เซ็นต์นี้หมายถึงอะไร? - -

100% คือค่าฐานของเงื่อนไขนี้ เช่น 109% คือดาเมจมากกว่าค่าฐาน 9% เปรียบเทียบภายในทีมและเงื่อนไขเดียวกัน

- {([['overallPercent', 'ดาเมจทั้งทีม'], ['personalPercent', 'ดาเมจส่วนตัว']] as const).map(([key, label]) => { - if (!group.rows.some((row) => Number(row[key]) > 0)) return null; - const references = comparisonReferenceNames(group.rows, key); - return

{label} · แถวที่แสดง 100%: {references.length ? references.join(", ") : "ผู้เขียนยังไม่ได้ระบุแถว 100%"}

; - })} -
-
}
- {group.rows.map((row, index) => (!exporting ? ( - - - - - - - {index + 1}. {row.weapon.name} R{row.refinement} - -
- {([['overallPercent', 'ทั้งทีม'], ['personalPercent', 'ส่วนตัว']] as const).map(([key, label]) => comparisonDelta(row[key]) !== null ? -

{metric(row[key])}

{label}

{comparisonDelta(row[key])}

: null)} - {comparisonDelta(row.overallPercent) === null && comparisonDelta(row.personalPercent) === null && ยังไม่มีผลคำนวณ} -
- {row.note &&

{row.note}

} -
-
- ) : ( + {group.rows.map((row, index) => ( - )))} + ))}
@@ -834,9 +729,6 @@ function ArtifactSectionContent({ ) : null}
-

- อาร์ติแฟกต์และสแตทที่แนะนำ -

)} -
+
{(() => { const tierCards = guide.artifactGroups.map((condition, conditionIndex) => (
@@ -1275,9 +1167,6 @@ function ConstellationSection({ guide }: { guide: PublicGuide }) { return (
-

- กลุ่มดาวที่แนะนำ -

-

คำนวณความเสียหาย

คำนวณทีม

@@ -1415,7 +1303,6 @@ function ExtraSectionContent({ /> ) : null}
-

คู่มือเสริม

{extra.title}

{action}
diff --git a/components/public/weapon-display-mode.tsx b/components/public/weapon-display-mode.tsx index 0dcbbf3..fb39ae7 100644 --- a/components/public/weapon-display-mode.tsx +++ b/components/public/weapon-display-mode.tsx @@ -46,15 +46,15 @@ export function WeaponDisplayMode({ return (
{ if (values[0]) setMode(values[0]); }} > - รายการ - กราฟ + List + Chart {mode === "chart" ? : children}