diff --git a/src/components/map/track-hover-info/TrackHoverInfoPopup.js b/src/components/map/track-hover-info/TrackHoverInfoPopup.js index 7d96871..8d17120 100644 --- a/src/components/map/track-hover-info/TrackHoverInfoPopup.js +++ b/src/components/map/track-hover-info/TrackHoverInfoPopup.js @@ -20,12 +20,23 @@ export default function TrackHoverInfoPopup(props) { + ); } +function InfoPopupSwitchItems(props) { + const { track } = props; + if (!track.switch) return null; + + return <> + + + +} + function processItemValue(value, options) { const { translationConstKey, join, subOptions, suffix } = options || {}; @@ -37,7 +48,7 @@ function processItemValue(value, options) { return TrackHoverInfoConsts[translationConstKey]?.[value] || value; } - if (!value) { + if (value === undefined || value === null || value === '') { return "N/A"; } diff --git a/src/helpers/constants.js b/src/helpers/constants.js index bdce374..5665913 100644 --- a/src/helpers/constants.js +++ b/src/helpers/constants.js @@ -70,12 +70,11 @@ const Constants = { }, { id: 'switches-names', - name: 'Switches names', + name: 'Switch names', default: false, }, { id: 'isolations-ids', - name: 'Isolations IDs', name: 'Isolations', default: false, }, diff --git a/src/model/switch.js b/src/model/switch.js index f0a898a..b19cc39 100644 --- a/src/model/switch.js +++ b/src/model/switch.js @@ -7,6 +7,7 @@ import Constants from "../helpers/constants.js"; export default class Switch extends SceneryObject { model; + bare_model; data; id_isolation; id_switch;