diff --git a/public/NPED_Cat_D.svg b/public/NPED_Cat_D.svg
new file mode 100644
index 0000000..40a235a
--- /dev/null
+++ b/public/NPED_Cat_D.svg
@@ -0,0 +1,11 @@
+
+
\ No newline at end of file
diff --git a/src/components/HistoryList/AlertItem.tsx b/src/components/HistoryList/AlertItem.tsx
index 97df557..d02613d 100644
--- a/src/components/HistoryList/AlertItem.tsx
+++ b/src/components/HistoryList/AlertItem.tsx
@@ -8,6 +8,7 @@ import { useCameraBlackboard } from "../../hooks/useCameraBlackboard";
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 NPED_CAT_D from "/NPED_Cat_D.svg";
import { checkIsHotListHit, formatAge, getNPEDCategory } from "../../utils/utils";
import { faX } from "@fortawesome/free-solid-svg-icons";
import { faClock } from "@fortawesome/free-regular-svg-icons";
@@ -30,6 +31,7 @@ const AlertItem = ({ item }: AlertItemProps) => {
const isNPEDHitA = cat === "A";
const isNPEDHitB = cat === "B";
const isNPEDHitC = cat === "C";
+ const isNPEDHitD = cat === "D";
const handleClick = () => {
setIsModalOpen(true);
@@ -69,6 +71,7 @@ const AlertItem = ({ item }: AlertItemProps) => {
{isNPEDHitA &&
}
{isNPEDHitB &&
}
{isNPEDHitC &&
}
+ {isNPEDHitD &&
}
{state?.alertList?.length > 0 ? (
- {state?.alertList?.map((alertItem) => (
-
- ))}
+ {state?.alertList?.map((alertItem) =>
).reverse()}
) : (
diff --git a/src/components/PopupSettings/NPEDCategoryPopup.tsx b/src/components/PopupSettings/NPEDCategoryPopup.tsx
index 8f5b279..c007714 100644
--- a/src/components/PopupSettings/NPEDCategoryPopup.tsx
+++ b/src/components/PopupSettings/NPEDCategoryPopup.tsx
@@ -10,6 +10,7 @@ import { toast } from "sonner";
const NPEDCategoryPopup = () => {
const { state, dispatch } = useIntegrationsContext();
+
const { mutation } = useCameraBlackboard();
const isCatAEnabled = state?.iscatEnabled?.catA;
@@ -34,8 +35,8 @@ const NPEDCategoryPopup = () => {
await mutation.mutateAsync({
operation: "SAVE",
path: "",
- value: null
- })
+ value: null,
+ });
if (result?.reason === "OK") toast.success("Pop up settings saved");
dispatch({ type: "NPEDCATENABLED", payload: values });
};
@@ -44,7 +45,7 @@ const NPEDCategoryPopup = () => {
Allows alerts to pop up to user.
-
+
diff --git a/src/components/SightingModal/SightingModal.tsx b/src/components/SightingModal/SightingModal.tsx
index a8091a2..f2cd196 100644
--- a/src/components/SightingModal/SightingModal.tsx
+++ b/src/components/SightingModal/SightingModal.tsx
@@ -10,7 +10,8 @@ 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, getHotlistName, getNPEDCategory } from "../../utils/utils";
+import NPED_CAT_D from "/NPED_Cat_D.svg";
+import { checkIsHotListHit, getHotlistName, getNPEDCategory, getNPEDReason } from "../../utils/utils";
type SightingModalProps = {
isSightingModalOpen: boolean;
@@ -74,11 +75,19 @@ const SightingModal = ({ isSightingModalOpen, handleClose, sighting, onDelete }:
};
const motionAway = (sighting?.motion ?? "").toUpperCase() === "AWAY";
+
const isHotListHit = checkIsHotListHit(sighting);
const cat = getNPEDCategory(sighting);
const isNPEDHitA = cat === "A";
const isNPEDHitB = cat === "B";
const isNPEDHitC = cat === "C";
+ const isNPEDHitD = cat === "D";
+
+ const reason = getNPEDReason(sighting);
+
+ const insuranceStatus = reason ? reason["INSURANCE STATUS"] : null;
+ const motStatus = reason ? reason["MOT STATUS"] : null;
+ const taxStatus = reason ? reason["TAX STATUS"] : null;
return (
<>
@@ -133,6 +142,7 @@ const SightingModal = ({ isSightingModalOpen, handleClose, sighting, onDelete }:
{isNPEDHitA &&

}
{isNPEDHitB &&

}
{isNPEDHitC &&

}
+ {isNPEDHitD &&

}
{hotlistNames && hotlistNames.length > 0 && (
@@ -158,44 +168,97 @@ const SightingModal = ({ isSightingModalOpen, handleClose, sighting, onDelete }:
Vehicle Info
-
- VRM
- - {sighting?.vrm ?? "-"}
+ - {sighting?.vrm ?? "-"}
+ {isNPEDHitA || isNPEDHitB || isNPEDHitC || isNPEDHitD ? (
+ <>
+
+
- Insurance
+ -
+ {insuranceStatus ? (
+
+ YES
+
+ ) : (
+
+ NO
+
+ )}
+
+
+
+
- MOT
+ -
+ {motStatus ? (
+
+ VALID
+
+ ) : (
+
+ EXPIRED
+
+ )}
+
+
+
+
- Tax
+ -
+ {taxStatus ? (
+
+ VALID
+
+ ) : (
+
+ EXPIRED
+
+ )}
+
+
+ >
+ ) : (
+ <>
+
+
- Motion
+ - {sighting?.motion ?? "-"}
+
+
+
- Seen Count
+ - {sighting?.seenCount ?? "-"}
+
-
-
- Motion
- - {sighting?.motion ?? "-"}
-
-
-
- Seen Count
- - {sighting?.seenCount ?? "-"}
-
+ {sighting?.make && sighting.make.trim() && sighting.make.toLowerCase() !== "disabled" && (
+
+
- Make
+ - {sighting.make}
+
+ )}
- {sighting?.make && sighting.make.trim() && sighting.make.toLowerCase() !== "disabled" && (
-
-
- Make
- - {sighting.make}
-
+ {sighting?.model && sighting.model.trim() && sighting.model.toLowerCase() !== "disabled" && (
+
+
- Model
+ - {sighting.model}
+
+ )}
+
+ {sighting?.color && sighting.color.trim() && sighting.color.toLowerCase() !== "disabled" && (
+
+
- Colour
+ - {sighting.color}
+
+ )}
+
+
+
- Time
+ - {sighting?.timeStamp ?? "-"}
+
+ >
)}
-
- {sighting?.model && sighting.model.trim() && sighting.model.toLowerCase() !== "disabled" && (
-
-
- Model
- - {sighting.model}
-
- )}
-
- {sighting?.color && sighting.color.trim() && sighting.color.toLowerCase() !== "disabled" && (
-
-
- Colour
- - {sighting.color}
-
- )}
-
-
-
- Time
- - {sighting?.timeStamp ?? "-"}
-
diff --git a/src/components/SightingsWidget/SightingWidget.tsx b/src/components/SightingsWidget/SightingWidget.tsx
index fe31fe7..4c35e38 100644
--- a/src/components/SightingsWidget/SightingWidget.tsx
+++ b/src/components/SightingsWidget/SightingWidget.tsx
@@ -12,14 +12,10 @@ 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 popup from "../../assets/sounds/ui/popup_open.mp3";
-import notification from "../../assets/sounds/ui/notification.mp3";
-import { useSound } from "react-sounds";
+import NPED_CAT_D from "/NPED_Cat_D.svg";
import { useIntegrationsContext } from "../../context/IntegrationsContext";
-import { useSoundContext } from "../../context/SoundContext";
import Loading from "../UI/Loading";
import { checkIsHotListHit, getNPEDCategory } from "../../utils/utils";
-import { useCachedSoundSrc } from "../../hooks/usecachedSoundSrc";
function useNow(tickMs = 1000) {
const [, setNow] = useState(() => Date.now());
@@ -41,14 +37,9 @@ type SightingHistoryProps = {
export default function SightingHistoryWidget({ className, title }: SightingHistoryProps) {
const [modalQueue, setModalQueue] = useState