import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { useAlertHitContext } from "../../context/AlertHitContext"; import type { SightingType } from "../../types/types"; import Card from "../UI/Card"; import CardHeader from "../UI/CardHeader"; import AlertItem from "./AlertItem"; import { faTrash } from "@fortawesome/free-solid-svg-icons"; const HistoryList = () => { const { state, dispatch } = useAlertHitContext(); const handleDeleteClick = (alertItem: SightingType) => dispatch({ type: "REMOVE", payload: alertItem }); return (
{state?.alertList?.length > 0 ? ( state?.alertList?.map((alertItem, index) => (
)) ) : (

No Alert results

)}
); }; export default HistoryList;