From 1599ad066f662709b9cbdd0b8c6518cdf9ceae47 Mon Sep 17 00:00:00 2001 From: Toba Ojo Date: Fri, 19 Sep 2025 11:22:09 +0100 Subject: [PATCH] added Hotlist flag ad tag --- src/components/HistoryList/AlertItem.tsx | 12 +++++-- .../SightingsWidget/SightingWidget.tsx | 32 +++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/src/components/HistoryList/AlertItem.tsx b/src/components/HistoryList/AlertItem.tsx index 1a531fe..e423cff 100644 --- a/src/components/HistoryList/AlertItem.tsx +++ b/src/components/HistoryList/AlertItem.tsx @@ -3,6 +3,7 @@ import NumberPlate from "../PlateStack/NumberPlate"; import SightingModal from "../SightingModal/SightingModal"; import InfoBar from "../SightingsWidget/InfoBar"; import { useState } from "react"; +import HotListImg from "/Hotlist_Hit.svg"; type AlertItemProps = { item: SightingType; @@ -11,7 +12,8 @@ type AlertItemProps = { const AlertItem = ({ item }: AlertItemProps) => { const [isModalOpen, setIsModalOpen] = useState(false); const motionAway = (item?.motion ?? "").toUpperCase() === "AWAY"; - const isNPEDHit = item?.metadata?.npedJSON?.status_code === 404; + // const isNPEDHit = item?.metadata?.npedJSON?.status_code === 404; + const isHotListHit = item?.metadata?.hotlistMatches?.Hotlist0 === true; const handleClick = () => { setIsModalOpen(true); @@ -27,7 +29,13 @@ const AlertItem = ({ item }: AlertItemProps) => { className=" flex flex-row p-4 border border-gray-400 rounded-lg items-center w-full mx-auto justify-between" onClick={handleClick} > - {isNPEDHit && NPED Hit} + {isHotListHit && ( + hotlistHit + )}
MAKE: {item.make} MODEL: {item.model} diff --git a/src/components/SightingsWidget/SightingWidget.tsx b/src/components/SightingsWidget/SightingWidget.tsx index 479396e..0a5d524 100644 --- a/src/components/SightingsWidget/SightingWidget.tsx +++ b/src/components/SightingsWidget/SightingWidget.tsx @@ -9,6 +9,7 @@ import { useSightingFeedContext } from "../../context/SightingFeedContext"; import SightingModal from "../SightingModal/SightingModal"; // import { useAlertHitContext } from "../../context/AlertHitContext"; import InfoBar from "./InfoBar"; +import HotListImg from "/Hotlist_Hit.svg"; function useNow(tickMs = 1000) { const [, setNow] = useState(() => Date.now()); @@ -102,37 +103,19 @@ export default function SightingHistoryWidget({ const motionAway = (obj?.motion ?? "").toUpperCase() === "AWAY"; const primaryIsColour = obj?.srcCam === 1; const secondaryMissing = (obj?.vrmSecondary ?? "") === ""; - + const isHotListHit = + obj?.metadata?.hotlistMatches?.Hotlist0 === true; return (
onRowClick(obj)} > - {/* Info bar */} - {/* Patch row */}
- {obj?.plateUrlInfrared && ( -
- infrared patch -
- )} -
+ {isHotListHit && ( + hotlistHit + )}