diff --git a/frontend/src/pages/DashboardPage.jsx b/frontend/src/pages/DashboardPage.jsx index 451c52c..1ca497c 100644 --- a/frontend/src/pages/DashboardPage.jsx +++ b/frontend/src/pages/DashboardPage.jsx @@ -425,21 +425,23 @@ function RecentActivities({ activities }) { ) } +const DASH_PR_LABELS = ['1k', '1 mile', '5k', '10k'] + function RunningPRs({ records }) { + const byLabel = Object.fromEntries((records || []).map(r => [r.distance_label, r])) return ( - {records?.length > 0 ? ( -
- {records.slice(0, 5).map(rec => ( -
-

{rec.distance_label}

-

{formatDuration(rec.duration_s)}

+
+ {DASH_PR_LABELS.map(label => { + const rec = byLabel[label] + return ( +
+

{label}

+

{rec ? formatDuration(rec.duration_s) : '--'}

- ))} -
- ) : ( -
No running records yet
- )} + ) + })} +
) }