import { useAlertHitContext } from "../../context/AlertHitContext"; import { useCameraBlackboard } from "../../hooks/useCameraBlackboard"; import type { CameraBlackBoardOptions } from "../../types/types"; import Card from "../UI/Card"; import CardHeader from "../UI/CardHeader"; import AlertItem from "./AlertItem"; const HistoryList = () => { const { state, dispatch, isLoading, error } = useAlertHitContext(); const { mutation } = useCameraBlackboard(); const handleClearListClick = (listName: CameraBlackBoardOptions) => { dispatch({ type: "DELETE", payload: [] }); mutation.mutate({ operation: "DELETE", path: listName.path, }); }; return ( {isLoading &&

Loading...

} {error &&

Error: {error.message}

}
{state?.alertList?.length > 0 ? (
{state?.alertList?.map((alertItem) => ( ))}
) : (
No Alert Results

Alerts will appear here in real-time once there are Hotlist or{" "} NPED hits. Use{" "} Start Session to begin capturing results, or add a{" "} Sighting from the sighting list.

)}
); }; export default HistoryList;