diff options
Diffstat (limited to 'modern/src/StatusView.js')
-rw-r--r-- | modern/src/StatusView.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/modern/src/StatusView.js b/modern/src/StatusView.js index 61fd1504..0713d47e 100644 --- a/modern/src/StatusView.js +++ b/modern/src/StatusView.js @@ -3,9 +3,14 @@ import React from 'react'; import { useSelector } from 'react-redux'; import { formatPosition } from './common/formatter'; -const StatusView = (props) => { - const device = useSelector(state => state.devices.items[props.deviceId]); - const position = useSelector(state => state.positions.items[props.deviceId]); +const StatusView = ({ deviceId, onShowDetails }) => { + const device = useSelector(state => state.devices.items[deviceId]); + const position = useSelector(state => state.positions.items[deviceId]); + + const handleClick = e => { + e.preventDefault(); + onShowDetails(position.id); + }; return ( <> @@ -17,6 +22,7 @@ const StatusView = (props) => { {position.attributes.batteryLevel && <><b>{t('positionBattery')}:</b> {formatPosition(position.attributes.batteryLevel, 'batteryLevel')}<br /></> } + <a href="#" onClick={handleClick}>{t('sharedShowDetails')}</a> </> ); }; |