@@ -12,6 +12,7 @@ import { Spinner } from 'common/Loader';
12
12
import type { ArrayElement } from 'utils/types' ;
13
13
import type { PathResponse , PathWaypoint } from 'common/api/osrdEditoastApi' ;
14
14
import { formatUicToCi } from 'utils/strings' ;
15
+ import cx from 'classnames' ;
15
16
16
17
type Props = {
17
18
removeAllVias : ( ) => void ;
@@ -67,18 +68,18 @@ export default function ModalSugerredVias({ removeAllVias, pathfindingInProgress
67
68
const formatVia = ( via : ArrayElement < PathResponse [ 'steps' ] > , idx : number , idxTrueVia : number ) => (
68
69
< div
69
70
key = { `suggested-via-modal-${ via . id } -${ idx } ` }
70
- className = { ` d-flex align-items-center p-1 ${ via . suggestion && 'suggested-via-clickable' } ` }
71
+ className = { cx ( ' d-flex align-items-center p-1' , via . suggestion && 'suggested-via-clickable' ) }
71
72
title = { via . name ! }
72
73
>
73
74
{ ! via . suggestion && < small className = "pr-2" > { idxTrueVia } </ small > }
74
75
< i className = { `${ via . suggestion ? 'text-muted' : 'text-info' } icons-itinerary-bullet mr-2` } />
75
76
< span className = "suggested-via-name" > { via . name || '' } </ span >
76
- < span > { via . ch === '00' || ! via . ch ? 'BV' : ` ${ via . ch } ` } </ span >
77
- < small className = "text-muted ml-3" > { via . uic ? formatUicToCi ( via . uic ) : '' } </ small >
77
+ < span > { via . ch } </ span >
78
+ { via . uic && < small className = "text-muted ml-3" > { formatUicToCi ( via . uic ) } </ small > }
78
79
< div className = "ml-auto" >
79
- < small className = "mr-2" >
80
- { via . path_offset && `KM ${ Math . round ( via . path_offset ) / 1000 } ` }
81
- </ small >
80
+ { via . path_offset && (
81
+ < small className = "mr-2" > { `KM ${ Math . round ( via . path_offset ) / 1000 } ` } </ small >
82
+ ) }
82
83
{ via . suggestion && via . id && ! selectedViasTracks . includes ( via . id ) ? (
83
84
< button
84
85
className = "btn btn-sm btn-only-icon"
0 commit comments