@@ -29,6 +29,24 @@ import DangerousIcon from '@/sidebar/routeHints/warn_report.svg'
2929import { Bbox } from '@/api/graphhopper'
3030import { SettingsContext } from '@/contexts/SettingsContext'
3131import { Settings } from '@/stores/SettingsStore'
32+ import { icons } from '@/sidebar/search/routingProfiles/profileIcons'
33+ import React from 'react'
34+
35+ function getProfileIcon ( profileName : string ) {
36+ // First try to get exact match
37+ let icon = icons [ profileName ]
38+ if ( icon ) return React . createElement ( icon )
39+
40+ // If no exact match, try to find a base profile
41+ const baseProfile = Object . keys ( icons ) . find ( k => profileName . startsWith ( k + '_' ) )
42+ if ( baseProfile ) {
43+ icon = icons [ baseProfile ]
44+ if ( icon ) return React . createElement ( icon )
45+ }
46+
47+ // Fallback to question mark
48+ return React . createElement ( icons . question_mark )
49+ }
3250
3351export interface RoutingResultsProps {
3452 info : RoutingResultInfo
@@ -67,6 +85,7 @@ function RoutingResult({
6785 useEffect ( ( ) => setExpanded ( isSelected && isExpanded ) , [ isSelected ] )
6886 const settings = useContext ( SettingsContext )
6987 const showDistanceInMiles = settings . showDistanceInMiles
88+ const isMobile = useMediaQuery ( { query : '(max-width: 44rem)' } )
7089
7190 const fordInfo = getInfoFor ( path . points , path . details . road_environment , s => s === 'ford' )
7291 const tollInfo = getInfoFor (
@@ -144,7 +163,10 @@ function RoutingResult({
144163 < div className = { styles . resultSelectableArea } onClick = { ( ) => Dispatcher . dispatch ( new SetSelectedPath ( path ) ) } >
145164 < div className = { resultSummaryClass } >
146165 < div className = { styles . resultValues } >
147- < span className = { styles . resultMainText } > { milliSecondsToText ( path . time ) } </ span >
166+ < span className = { styles . resultMainText } >
167+ { isMobile && < span className = { styles . profileIcon } > { getProfileIcon ( profile ) } </ span > }
168+ { milliSecondsToText ( path . time ) }
169+ </ span >
148170 < span className = { styles . resultSecondaryText } >
149171 { metersToShortText ( path . distance , showDistanceInMiles ) }
150172 </ span >
0 commit comments