- 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

@@ -10,6 +10,7 @@ import HotListImg from "/Hotlist_Hit.svg";
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 SightingModalProps = {
isSightingModalOpen: boolean;
@@ -65,7 +66,7 @@ const SightingModal = ({
};
const motionAway = (sighting?.motion ?? "").toUpperCase() === "AWAY";
const isHotListHit = sighting?.metadata?.hotlistMatches?.Hotlist0 === true;
const isHotListHit = checkIsHotListHit(sighting);
const isNPEDHitA = sighting?.metadata?.npedJSON?.["NPED CATEGORY"] === "A";
const isNPEDHitB = sighting?.metadata?.npedJSON?.["NPED CATEGORY"] === "B";
const isNPEDHitC = sighting?.metadata?.npedJSON?.["NPED CATEGORY"] === "C";