fixed type errors
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import type { SightingType, SightingWidgetType } from "../../types/types";
|
||||
import type { SightingType } from "../../types/types";
|
||||
import { BLANK_IMG } from "../../utils/utils";
|
||||
import NumberPlate from "../PlateStack/NumberPlate";
|
||||
import Card from "../UI/Card";
|
||||
@@ -44,10 +44,10 @@ export default function SightingHistoryWidget({
|
||||
selectedSighting,
|
||||
} = useSightingFeedContext();
|
||||
|
||||
const { disptach } = useAlertHitContext();
|
||||
const { dispatch } = useAlertHitContext();
|
||||
|
||||
const onRowClick = useCallback(
|
||||
(sighting: SightingType | SightingWidgetType) => {
|
||||
(sighting: SightingType) => {
|
||||
if (!sighting) return;
|
||||
setSightingModalOpen(!isSightingModalOpen);
|
||||
setSelectedSighting(sighting);
|
||||
@@ -55,7 +55,7 @@ export default function SightingHistoryWidget({
|
||||
[isSightingModalOpen, setSelectedSighting, setSightingModalOpen]
|
||||
);
|
||||
const rows = useMemo(
|
||||
() => sightings?.filter(Boolean) as SightingWidgetType[],
|
||||
() => sightings?.filter(Boolean) as SightingType[],
|
||||
[sightings]
|
||||
);
|
||||
|
||||
@@ -64,13 +64,13 @@ export default function SightingHistoryWidget({
|
||||
const isNPEDHit = obj?.metadata?.npedJSON?.status_code === 404;
|
||||
|
||||
if (isNPEDHit) {
|
||||
disptach({
|
||||
dispatch({
|
||||
type: "ADD",
|
||||
payload: obj,
|
||||
});
|
||||
}
|
||||
});
|
||||
}, [rows, disptach]);
|
||||
}, [rows, dispatch]);
|
||||
|
||||
const handleClose = () => {
|
||||
setSightingModalOpen(false);
|
||||
|
||||
Reference in New Issue
Block a user