From fad7cecbc026714359e64942b63cac4214b83747 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Wed, 4 Oct 2023 06:20:26 -0600 Subject: [PATCH] Add support for other icons --- web/src/components/TimelineSummary.jsx | 12 +++++++++--- web/src/icons/DeliveryTruck.jsx | 15 +++++++++++++++ web/src/icons/LicensePlate.jsx | 15 +++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 web/src/icons/DeliveryTruck.jsx create mode 100644 web/src/icons/LicensePlate.jsx diff --git a/web/src/components/TimelineSummary.jsx b/web/src/components/TimelineSummary.jsx index 02db2e26f..fd7a85411 100644 --- a/web/src/components/TimelineSummary.jsx +++ b/web/src/components/TimelineSummary.jsx @@ -8,7 +8,9 @@ import PlayIcon from '../icons/Play'; import ExitIcon from '../icons/Exit'; import StationaryObjectIcon from '../icons/StationaryObject'; import FaceIcon from '../icons/Face'; -import { Zone } from '../icons/Zone'; +import LicensePlateIcon from '../icons/LicensePlate'; +import DeliveryTruckIcon from '../icons/DeliveryTruck'; +import ZoneIcon from '../icons/Zone'; import { useMemo, useState } from 'preact/hooks'; import Button from './Button'; @@ -125,11 +127,15 @@ function getTimelineIcon(timelineItem) { case 'stationary': return ; case 'entered_zone': - return ; + return ; case 'attribute': switch (timelineItem.data.attribute) { case 'face': return ; + case 'license_plate': + return ; + default: + return ; } } } @@ -169,7 +175,7 @@ function getTimelineItemDescription(config, timelineItem, event) { date_style: 'short', time_style: 'medium', time_format: config.ui.time_format, - }, + } )}`; case 'gone': return `${event.label} left at ${formatUnixTimestampToDateTime(timelineItem.timestamp, { diff --git a/web/src/icons/DeliveryTruck.jsx b/web/src/icons/DeliveryTruck.jsx new file mode 100644 index 000000000..01a48e5f2 --- /dev/null +++ b/web/src/icons/DeliveryTruck.jsx @@ -0,0 +1,15 @@ +import { h } from 'preact'; +import { memo } from 'preact/compat'; + +export function StationaryObject({ className = '' }) { + return ( + + + + ); +} + +export default memo(StationaryObject); diff --git a/web/src/icons/LicensePlate.jsx b/web/src/icons/LicensePlate.jsx new file mode 100644 index 000000000..e2f4aae8f --- /dev/null +++ b/web/src/icons/LicensePlate.jsx @@ -0,0 +1,15 @@ +import { h } from 'preact'; +import { memo } from 'preact/compat'; + +export function StationaryObject({ className = '' }) { + return ( + + + + ); +} + +export default memo(StationaryObject);