ok we fix
This commit is contained in:
parent
37877bf4dd
commit
7ae78a719e
1 changed files with 9 additions and 3 deletions
|
|
@ -3,7 +3,7 @@ import React, { useEffect, useMemo, useState } from "react";
|
||||||
|
|
||||||
type Row = Record<string, string>;
|
type Row = Record<string, string>;
|
||||||
|
|
||||||
const ResultCell = ({ value }: { value: string | undefined }) => {
|
const ResultCell = ({ value, isTotal = false }: { value: string | undefined; isTotal?: boolean }) => {
|
||||||
if (!value) return <td className="border p-2">—</td>;
|
if (!value) return <td className="border p-2">—</td>;
|
||||||
|
|
||||||
const numValue = parseFloat(value);
|
const numValue = parseFloat(value);
|
||||||
|
|
@ -12,6 +12,12 @@ const ResultCell = ({ value }: { value: string | undefined }) => {
|
||||||
|
|
||||||
const displayValue = isNegative ? Math.abs(numValue).toString() : value;
|
const displayValue = isNegative ? Math.abs(numValue).toString() : value;
|
||||||
|
|
||||||
|
// For total cells, just make text bold
|
||||||
|
if (isTotal) {
|
||||||
|
return <td className="border p-2 font-bold">{displayValue}</td>;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For lift attempt cells, show colored backgrounds
|
||||||
if (isNegative) {
|
if (isNegative) {
|
||||||
return (
|
return (
|
||||||
<td className="border p-2 bg-red-600 text-white font-semibold">
|
<td className="border p-2 bg-red-600 text-white font-semibold">
|
||||||
|
|
@ -157,8 +163,8 @@ export function ResultsTable() {
|
||||||
<ResultCell value={r[squatCol]} />
|
<ResultCell value={r[squatCol]} />
|
||||||
<ResultCell value={r[benchCol]} />
|
<ResultCell value={r[benchCol]} />
|
||||||
<ResultCell value={r[deadliftCol]} />
|
<ResultCell value={r[deadliftCol]} />
|
||||||
<ResultCell value={r["TotalKg"]} />
|
<ResultCell value={r["TotalKg"]} isTotal />
|
||||||
<ResultCell value={r["GLPoints"]} />
|
<ResultCell value={r["GLPoints"]} isTotal />
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue