- refactored code around hotlist hits and sounds

- improved performace for sounds playing
This commit is contained in:
2025-10-09 14:11:58 +01:00
parent 87be346c3b
commit 063815cac0
7 changed files with 57 additions and 85 deletions

View File

@@ -8,6 +8,7 @@ import { useAlertHitContext } from "../../context/AlertHitContext";
import NPED_CAT_A from "/NPED_Cat_A.svg";
import NPED_CAT_B from "/NPED_Cat_B.svg";
import NPED_CAT_C from "/NPED_Cat_C.svg";
import { checkIsHotListHit } from "../../utils/utils";
type AlertItemProps = {
item: SightingType;
@@ -19,9 +20,8 @@ const AlertItem = ({ item }: AlertItemProps) => {
// const {d} = useCameraBlackboard();
const motionAway = (item?.motion ?? "").toUpperCase() === "AWAY";
// [34].metadata.hotlistMatches["MAV_Hotlist.csv"]
//check if true is in any hotlist property
const isHotListHit = item?.metadata?.hotlistMatches?.Hotlist0 === true;
const isHotListHit = checkIsHotListHit(item);
const isNPEDHitA = item?.metadata?.npedJSON?.["NPED CATEGORY"] === "A";
const isNPEDHitB = item?.metadata?.npedJSON?.["NPED CATEGORY"] === "B";
const isNPEDHitC = item?.metadata?.npedJSON?.["NPED CATEGORY"] === "C";