Skip to content

Commit d87fc41

Browse files
committed
Add readonly public transportation mode info into stop edit form
1 parent bd0081a commit d87fc41

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

ui/src/components/forms/stop/components/StopAreaInfoSection.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useTranslation } from 'react-i18next';
55
import { Link } from 'react-router';
66
import { twMerge } from 'tailwind-merge';
77
import { useObservationDateQueryParam } from '../../../../hooks';
8+
import { mapVehicleModeToUiName } from '../../../../i18n/uiNameMappings';
89
import { Path, routeDetails } from '../../../../router/routeDetails';
910
import { ExpandButton } from '../../../../uiComponents';
1011
import { LabeledDetail } from '../../../stop-registry/stops/stop-details/layout';
@@ -45,6 +46,9 @@ export const StopAreaInfoSection: FC<StopAreaInfoSectionProps> = ({
4546
});
4647

4748
const stopArea = useWatch<StopFormState, 'stopArea'>({ name: 'stopArea' });
49+
const vehicleMode = useWatch<StopFormState, 'vehicleMode'>({
50+
name: 'vehicleMode',
51+
});
4852

4953
if (!stopArea) {
5054
return null;
@@ -143,6 +147,13 @@ export const StopAreaInfoSection: FC<StopAreaInfoSectionProps> = ({
143147
</>
144148
)}
145149
</Transition>
150+
151+
{vehicleMode && (
152+
<span className="mt-1 font-bold">
153+
{t('stopArea.transportMode')}:{' '}
154+
{mapVehicleModeToUiName(t, vehicleMode)}
155+
</span>
156+
)}
146157
</div>
147158
);
148159
};

0 commit comments

Comments
 (0)