diff --git a/site/src/components/AthleteView.svelte b/site/src/components/AthleteView.svelte index 743a198..538b8b5 100644 --- a/site/src/components/AthleteView.svelte +++ b/site/src/components/AthleteView.svelte @@ -151,6 +151,13 @@ $: if (activeTab === 'gear' && isOwner && !gearFetched && !gearLoading) gearFetch(); + $: gearDistances = Object.fromEntries( + gearItems.map(g => [ + g.name, + allActivities.filter(a => a.gear === g.name).reduce((sum, a) => sum + (a.distance_m ?? 0), 0), + ]) + ); + $: if (activeTab === 'segments' && segmentsHandle && !segmentsFetched && !segmentsLoading) { segmentsLoading = true; segmentsFetched = true; @@ -483,6 +490,9 @@
{GEAR_ICONS[item.type] ?? '⚙️'} {item.name} + {#if gearDistances[item.name] > 0} + {formatDistance(gearDistances[item.name])} + {/if} {#if item.retired} Retired {/if} diff --git a/site/src/lib/types.ts b/site/src/lib/types.ts index 2dc1c32..62ec87e 100644 --- a/site/src/lib/types.ts +++ b/site/src/lib/types.ts @@ -69,6 +69,7 @@ export interface ActivitySummary { climbing_vam_mh?: number | null; climbing_time_s?: number | null; source: string | null; + gear: string | null; privacy: Privacy; detail_url: string | null; track_url: string | null;