Skip to content

Commit 9c95738

Browse files
committed
Hide Training Load from health score UI when no strain data available
1 parent 65c1527 commit 9c95738

File tree

1 file changed

+29
-23
lines changed

1 file changed

+29
-23
lines changed

frontend/src/features/dashboard/StatisticsPage.tsx

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -605,14 +605,22 @@ export function StatisticsPage() {
605605
<div>
606606
<CardTitle>Health Status Score</CardTitle>
607607
<CardDescription>
608-
Composite: recovery core (60%) + training load (20%) + behavior
609-
(20%)
608+
{healthScore.trainingLoad !== null
609+
? "Composite: recovery core (60%) + training load (20%) + behavior (20%)"
610+
: "Composite: recovery core (75%) + behavior support (25%)"}
610611
</CardDescription>
611612
</div>
612613
</div>
613614
</CardHeader>
614615
<CardContent>
615-
<div className="grid gap-6 md:grid-cols-2 lg:grid-cols-4">
616+
<div
617+
className={cn(
618+
"grid gap-6 md:grid-cols-2",
619+
healthScore.trainingLoad !== null
620+
? "lg:grid-cols-4"
621+
: "lg:grid-cols-3",
622+
)}
623+
>
616624
<div className="text-center">
617625
<p className="text-sm text-muted-foreground mb-1">Overall</p>
618626
<p
@@ -652,26 +660,24 @@ export function StatisticsPage() {
652660
HRV + RHR + Sleep + Stress
653661
</p>
654662
</div>
655-
<div className="text-center">
656-
<p className="text-sm text-muted-foreground mb-1">
657-
Training Load
658-
</p>
659-
<p
660-
className={cn(
661-
"text-3xl font-bold",
662-
healthScore.trainingLoad !== null
663-
? getHealthScoreColor(healthScore.trainingLoad)
664-
: "text-muted-foreground",
665-
)}
666-
>
667-
{healthScore.trainingLoad !== null
668-
? healthScore.trainingLoad.toFixed(2)
669-
: "—"}
670-
</p>
671-
<p className="text-xs text-muted-foreground mt-1">
672-
Strain optimality
673-
</p>
674-
</div>
663+
{healthScore.trainingLoad !== null && (
664+
<div className="text-center">
665+
<p className="text-sm text-muted-foreground mb-1">
666+
Training Load
667+
</p>
668+
<p
669+
className={cn(
670+
"text-3xl font-bold",
671+
getHealthScoreColor(healthScore.trainingLoad),
672+
)}
673+
>
674+
{healthScore.trainingLoad.toFixed(2)}
675+
</p>
676+
<p className="text-xs text-muted-foreground mt-1">
677+
Strain optimality
678+
</p>
679+
</div>
680+
)}
675681
<div className="text-center">
676682
<p className="text-sm text-muted-foreground mb-1">
677683
Behavior Support

0 commit comments

Comments
 (0)