import { faCheck, faX } from "@fortawesome/free-solid-svg-icons"; import type { SightingType } from "../../types/types"; import NumberPlate from "../PlateStack/NumberPlate"; import ModalComponent from "../UI/ModalComponent"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useAlertHitContext } from "../../context/AlertHitContext"; import { toast, Toaster } from "sonner"; 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"; type SightingModalProps = { isSightingModalOpen: boolean; handleClose: () => void; sighting: SightingType | null; }; const SightingModal = ({ isSightingModalOpen, handleClose, sighting, }: SightingModalProps) => { const { dispatch } = useAlertHitContext(); const handleAcknowledgeButton = () => { if (!sighting) { toast.error("Cannot add sigthing to alert list"); handleClose(); return; } dispatch({ type: "ADD", payload: sighting }); toast.success("Sighting successfully added to alert list"); handleClose(); }; const motionAway = (sighting?.motion ?? "").toUpperCase() === "AWAY"; const isHotListHit = sighting?.metadata?.hotlistMatches?.Hotlist0 === true; const isNPEDHitA = sighting?.metadata?.npedJSON?.["NPED CATEGORY"] === "A"; const isNPEDHitB = sighting?.metadata?.npedJSON?.["NPED CATEGORY"] === "B"; const isNPEDHitC = sighting?.metadata?.npedJSON?.["NPED CATEGORY"] === "C"; const isNPEDHitD = sighting?.metadata?.npedJSON?.["NPED CATEGORY"] === "D"; return ( <> Sighting Details {isHotListHit && ( )} {isNPEDHitA && ( )} {isNPEDHitB && ( )} {isNPEDHitC && ( )} {isNPEDHitD && ( )} Accept Deny > ); }; export default SightingModal;