1
1
/* eslint-disable @typescript-eslint/no-explicit-any */
2
2
import React , { useEffect , useState } from 'react' ;
3
3
4
- import { Select } from '@osrd-project/ui-core' ;
5
4
import { point } from '@turf/helpers' ;
6
5
import { omit } from 'lodash' ;
7
6
import { useTranslation } from 'react-i18next' ;
@@ -24,6 +23,7 @@ import { type PathStep } from 'reducers/osrdconf/types';
24
23
import { getPointCoordinates } from 'utils/geometry' ;
25
24
26
25
import type { FeatureInfoClick } from '../types' ;
26
+ import OperationalPointPopupDetails from './OperationalPointPopupDetails' ;
27
27
28
28
type AddPathStepPopupProps = {
29
29
pathProperties ?: ManageTrainSchedulePathProperties ;
@@ -177,34 +177,22 @@ const AddPathStepPopup = ({
177
177
closeOnClick = { false }
178
178
className = "map-popup-click-select"
179
179
>
180
- < div className = "details" >
181
- < div className = "details-track" >
182
- { featureInfoClick . isOperationalPoint &&
183
- featureInfoClick . feature . properties . extensions_sncf_track_name }
184
- < small > { featureInfoClick . feature . properties . extensions_sncf_line_code } </ small >
185
- </ div >
186
- < div className = "details-line" >
187
- { featureInfoClick . isOperationalPoint ? (
188
- < >
189
- { featureInfoClick . feature . properties . extensions_identifier_name } < br />
190
- { featureInfoClick . feature . properties . extensions_sncf_trigram } { ' ' }
191
- { featureInfoClick . feature . properties . extensions_sncf_ch }
192
- </ >
193
- ) : (
194
- featureInfoClick . feature . properties . extensions_sncf_line_name
195
- ) }
196
- </ div >
197
- </ div >
198
-
199
- { featureInfoClick . isOperationalPoint && clickedOp ?. tracks && (
200
- < Select
201
- getOptionLabel = { ( option ) => option ?. trackName || t ( 'anyTrack' ) }
202
- getOptionValue = { ( option ) => option ?. trackName || '' }
203
- id = "select-track"
204
- onChange = { ( selectedOption ) => setSelectedTrack ( selectedOption ) }
205
- options = { clickedOp . tracks }
206
- value = { selectedTrack }
180
+ { featureInfoClick . isOperationalPoint ? (
181
+ < OperationalPointPopupDetails
182
+ operationalPoint = { featureInfoClick }
183
+ clickedOp = { clickedOp ! }
184
+ selectedTrack = { selectedTrack ! }
185
+ setSelectedTrack = { setSelectedTrack }
207
186
/>
187
+ ) : (
188
+ < div className = "details" >
189
+ < div className = "details-track" >
190
+ < small > { featureInfoClick . feature . properties . extensions_sncf_line_code } </ small >
191
+ </ div >
192
+ < div className = "details-line" >
193
+ { featureInfoClick . feature . properties . extensions_sncf_line_name }
194
+ </ div >
195
+ </ div >
208
196
) }
209
197
210
198
< div className = "actions" >
0 commit comments