From b40ce605153ac162b96db205e4d38ad7c9b2e705 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 31 Jul 2022 16:00:56 -0700 Subject: Better event formatting --- modern/src/main/EventsDrawer.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modern/src/main/EventsDrawer.js b/modern/src/main/EventsDrawer.js index d6b616ef..69b7e1b8 100644 --- a/modern/src/main/EventsDrawer.js +++ b/modern/src/main/EventsDrawer.js @@ -5,6 +5,7 @@ import { } from '@mui/material'; import { makeStyles } from '@mui/styles'; import DeleteIcon from '@mui/icons-material/Delete'; +import { formatNotificationTitle, formatTime } from '../common/util/formatter'; import { useTranslation } from '../common/components/LocalizationProvider'; import { eventsActions } from '../store'; @@ -26,8 +27,17 @@ const EventsDrawer = ({ open, onClose }) => { const dispatch = useDispatch(); const t = useTranslation(); + const devices = useSelector((state) => state.devices.items); + const events = useSelector((state) => state.events.items); + const formatType = (event) => formatNotificationTitle(t, { + type: event.type, + attributes: { + alarms: event.attributes.alarm, + }, + }); + return ( { {events.map((event) => ( - + dispatch(eventsActions.delete(event))}> -- cgit v1.2.3