added Hotlist flag ad tag

This commit is contained in:
2025-09-19 11:22:09 +01:00
parent 047251756e
commit 1599ad066f
2 changed files with 21 additions and 23 deletions

View File

@@ -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 && <small className="text-red-500">NPED Hit</small>}
{isHotListHit && (
<img
src={HotListImg}
alt="hotlistHit"
className="h-20 object-contain rounded-md"
/>
)}
<div className="flex flex-col">
<small>MAKE: {item.make}</small>
<small>MODEL: {item.model}</small>