summaryrefslogtreecommitdiff
path: root/web/frontend/ride-detail-logic.ts
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2026-08-17 09:06:41 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2026-08-17 09:06:41 +0200
commit2a20ea69a3d62c32c09e62e756a872a3042372b2 (patch)
treee57fb5a35ba19ae252fb32f7f95e9f585d7973d7 /web/frontend/ride-detail-logic.ts
parentfcbfad33a8e8fdb671d2907b55a8074df9a558e6 (diff)
feat(web): refine ride profile climb labels
Diffstat (limited to 'web/frontend/ride-detail-logic.ts')
-rw-r--r--web/frontend/ride-detail-logic.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/web/frontend/ride-detail-logic.ts b/web/frontend/ride-detail-logic.ts
index a2ba80a..f8eb040 100644
--- a/web/frontend/ride-detail-logic.ts
+++ b/web/frontend/ride-detail-logic.ts
@@ -28,7 +28,10 @@ export const categoryForCotacol = (cotacol: number): string => {
return "HC";
};
-export const formatClimbLabel = (name: string, category: string, cotacol: number): string => name || `${category} ${cotacol.toFixed(1)}`;
+export const formatClimbLabel = (name: string, category: string, cotacol: number, officialClimb = false): string => {
+ if (name) return officialClimb ? `${name} (${category})` : name;
+ return `${category} ${cotacol.toFixed(1)}`;
+};
export const elevationAtDistance = (points: ProfilePoint[], index: number, distanceM: number): number => {
if (index + 1 >= points.length) return points[index].elevationM;