diff options
Diffstat (limited to 'web/frontend/ride-detail-logic.ts')
| -rw-r--r-- | web/frontend/ride-detail-logic.ts | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/web/frontend/ride-detail-logic.ts b/web/frontend/ride-detail-logic.ts index f8eb040..e0f7281 100644 --- a/web/frontend/ride-detail-logic.ts +++ b/web/frontend/ride-detail-logic.ts @@ -28,8 +28,17 @@ export const categoryForCotacol = (cotacol: number): string => { return "HC"; }; -export const formatClimbLabel = (name: string, category: string, cotacol: number, officialClimb = false): string => { - if (name) return officialClimb ? `${name} (${category})` : name; +type ClimbLabelKind = "official" | "detected"; + +interface ClimbLabelOptions { + name: string; + category: string; + cotacol: number; + kind: ClimbLabelKind; +} + +export const formatClimbLabel = ({ name, category, cotacol, kind }: ClimbLabelOptions): string => { + if (name) return kind === "official" ? `${name} (${category})` : name; return `${category} ${cotacol.toFixed(1)}`; }; |