import { comparisonDelta, comparisonReferenceNames } from "@/lib/guides/comparison"; type WeaponRows = Parameters[0]; export function ComparisonContext({ rows, metric }: { rows?: WeaponRows; metric?: "overallPercent" | "personalPercent"; }) { const references = rows && metric ? comparisonReferenceNames(rows, metric) : []; return
{!rows &&

100% = ค่าฐานของเงื่อนไขนี้ เช่น 109% หมายถึงสูงกว่าค่าฐาน 9% เปรียบเทียบภายในเงื่อนไขเดียวกัน

} {rows && metric ?

{metric === "overallPercent" ? "ดาเมจทั้งทีม" : "ดาเมจส่วนตัว"} - {references.length ? `รายการที่แสดง 100%: ${references.join(" / ")}` : "ดูหมายเหตุของเงื่อนไขสำหรับรายการที่ใช้เป็นค่าฐาน"}

: null}
; } export function ComparisonValue({ value }: { value: string | null }) { const delta = comparisonDelta(value); return

{delta ?? "ไม่มีข้อมูลเปรียบเทียบ"}

; }