From 205f1bfdcd01de8055f1973b5e79b946583d62a0 Mon Sep 17 00:00:00 2001 From: headpatsyou Date: Thu, 8 Jan 2026 12:41:38 +0000 Subject: [PATCH] table styling update --- src/components/competitions/ResultsTable.tsx | 40 +++++++++++++++++--- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/src/components/competitions/ResultsTable.tsx b/src/components/competitions/ResultsTable.tsx index 06ac270..2c0c79b 100644 --- a/src/components/competitions/ResultsTable.tsx +++ b/src/components/competitions/ResultsTable.tsx @@ -3,6 +3,34 @@ import React, { useEffect, useMemo, useState } from "react"; type Row = Record; +const ResultCell = ({ value }: { value: string | undefined }) => { + if (!value) return —; + + const numValue = parseFloat(value); + const isNegative = numValue < 0; + const isPositive = numValue > 0; + + const displayValue = isNegative ? Math.abs(numValue).toString() : value; + + if (isNegative) { + return ( + + {displayValue} + + ); + } + + if (isPositive) { + return ( + + {displayValue} + + ); + } + + return {value}; +}; + export function ResultsTable() { const [meets, setMeets] = useState<{ id: string; name: string }[]>([]); const [selectedMeet, setSelectedMeet] = useState(""); @@ -35,7 +63,7 @@ export function ResultsTable() { }, [rows, query]); const attemptOptions = (prefix: string) => { - const labelPrefix = prefix === "Squat" ? "Agachamento" : prefix === "Bench" ? "Supino" : "Levantamento terra"; + const labelPrefix = prefix === "Squat" ? "Agachamento" : prefix === "Bench" ? "Supino" : "Deadlift"; const opts = [1, 2, 3, 4] .map((n) => ({ key: `${prefix}${n}Kg`, label: `${labelPrefix} ${n}` })) .filter((o) => rows.some((r) => o.key in r)); @@ -126,11 +154,11 @@ export function ResultsTable() { {r["Equipment"]} {r["Division"]} {r["BodyweightKg"]} - {r[squatCol]} - {r[benchCol]} - {r[deadliftCol]} - {r["TotalKg"]} - {r["GLPoints"]} + + + + + ))}