- refactored to allow for stacking of special hits (NPED + Hotlist)

This commit is contained in:
2025-10-24 10:49:04 +01:00
parent a958901bed
commit 359f3781f2
4 changed files with 64 additions and 41 deletions

View File

@@ -147,10 +147,12 @@ export const checkIsHotListHit = (sigthing: SightingType | null) => {
};
export function getHotlistName(obj: HotlistMatches | undefined) {
if (!obj || Object.values(obj).includes(false)) return;
if (!obj) return;
const keys = Object.keys(obj);
return keys;
const hotlistNames = Object.entries(obj)
.filter(([, value]) => value === true)
.map(([key]) => key);
return hotlistNames;
}
export const getNPEDCategory = (r?: SightingType | null) =>