18 lines
864 B
TypeScript
18 lines
864 B
TypeScript
import { comparisonReferenceNames } from "@/lib/guides/comparison";
|
|
|
|
type WeaponRows = Parameters<typeof comparisonReferenceNames>[0];
|
|
|
|
export function ComparisonContext({ rows, metric }: {
|
|
rows?: WeaponRows;
|
|
metric?: "overallPercent" | "personalPercent";
|
|
}) {
|
|
const references = rows && metric ? comparisonReferenceNames(rows, metric) : [];
|
|
return <div className="flex flex-col gap-1 text-sm text-muted-foreground">
|
|
{rows && metric ? <p>
|
|
{metric === "overallPercent" ? "ดาเมจทั้งทีม" : "ดาเมจส่วนตัว"} - {references.length
|
|
? `รายการที่แสดง 100%: ${references.join(" / ")}`
|
|
: "ดูหมายเหตุของเงื่อนไขสำหรับรายการที่ใช้เป็นค่าฐาน"}
|
|
</p> : null}
|
|
</div>;
|
|
}
|