diff --git a/src/App.tsx b/src/App.tsx
index 6bb1323..6e6c017 100644
--- a/src/App.tsx
+++ b/src/App.tsx
@@ -6,19 +6,22 @@ import RearCamera from "./pages/RearCamera";
import SystemSettings from "./pages/SystemSettings";
import Session from "./pages/Session";
import { NPEDUserProvider } from "./context/providers/NPEDUserContextProvider";
+import { AlertHitProvider } from "./context/providers/AlertHitProvider";
function App() {
return (
-
- }>
- } />
- } />
- } />
- } />
- } />
-
-
+
+
+ }>
+ } />
+ } />
+ } />
+ } />
+ } />
+
+
+
);
}
diff --git a/src/components/CameraOverview/SnapshotContainer.tsx b/src/components/CameraOverview/SnapshotContainer.tsx
index c112bcd..0b92159 100644
--- a/src/components/CameraOverview/SnapshotContainer.tsx
+++ b/src/components/CameraOverview/SnapshotContainer.tsx
@@ -13,7 +13,7 @@ export const SnapshotContainer = ({
const { canvasRef, isError, isPending } = useGetOverviewSnapshot(side);
if (isError) return <>An error occurred>;
- if (isPending) return <>loading...>;
+ if (isPending) return <>Loading...>;
return (
diff --git a/src/components/CameraSettings/CameraSettingFields.tsx b/src/components/CameraSettings/CameraSettingFields.tsx
index 8eec8d0..c69735e 100644
--- a/src/components/CameraSettings/CameraSettingFields.tsx
+++ b/src/components/CameraSettings/CameraSettingFields.tsx
@@ -1,10 +1,19 @@
import { Formik, Field, Form } from "formik";
import type {
+ CameraConfig,
CameraSettingErrorValues,
CameraSettingValues,
} from "../../types/types";
-const CameraSettingFields = ({ initialData, updateCameraConfig }) => {
+type CameraSettingsProps = {
+ initialData: CameraConfig;
+ updateCameraConfig: (values: CameraSettingValues) => void;
+};
+
+const CameraSettingFields = ({
+ initialData,
+ updateCameraConfig,
+}: CameraSettingsProps) => {
const initialValues: CameraSettingValues = {
friendlyName: initialData?.propLEDDriverControlURI?.value,
cameraAddress: "",
diff --git a/src/components/HistoryList/AlertItem.tsx b/src/components/HistoryList/AlertItem.tsx
new file mode 100644
index 0000000..1a531fe
--- /dev/null
+++ b/src/components/HistoryList/AlertItem.tsx
@@ -0,0 +1,48 @@
+import type { SightingType } from "../../types/types";
+import NumberPlate from "../PlateStack/NumberPlate";
+import SightingModal from "../SightingModal/SightingModal";
+import InfoBar from "../SightingsWidget/InfoBar";
+import { useState } from "react";
+
+type AlertItemProps = {
+ item: SightingType;
+};
+
+const AlertItem = ({ item }: AlertItemProps) => {
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const motionAway = (item?.motion ?? "").toUpperCase() === "AWAY";
+ const isNPEDHit = item?.metadata?.npedJSON?.status_code === 404;
+
+ const handleClick = () => {
+ setIsModalOpen(true);
+ };
+
+ const closeModal = () => {
+ setIsModalOpen(false);
+ };
+ return (
+ <>
+
+
+ {isNPEDHit &&
NPED Hit}
+
+ MAKE: {item.make}
+ MODEL: {item.model}
+ COLOUR: {item.color}
+
+
+
+
+
+ >
+ );
+};
+
+export default AlertItem;
diff --git a/src/components/HistoryList/HistoryList.tsx b/src/components/HistoryList/HistoryList.tsx
new file mode 100644
index 0000000..af9a40d
--- /dev/null
+++ b/src/components/HistoryList/HistoryList.tsx
@@ -0,0 +1,25 @@
+import { useAlertHitContext } from "../../context/AlertHitContext";
+import Card from "../UI/Card";
+import CardHeader from "../UI/CardHeader";
+import AlertItem from "./AlertItem";
+
+const HistoryList = () => {
+ const { state } = useAlertHitContext();
+ console.log(state);
+ return (
+
+
+
+ {state?.alertList?.length >= 0 ? (
+ state?.alertList?.map((alertItem, index) => (
+
+ ))
+ ) : (
+
No Search results
+ )}
+
+
+ );
+};
+
+export default HistoryList;
diff --git a/src/components/PlateStack/Sighting.tsx b/src/components/PlateStack/Sighting.tsx
deleted file mode 100644
index 6b235b2..0000000
--- a/src/components/PlateStack/Sighting.tsx
+++ /dev/null
@@ -1,19 +0,0 @@
-import NumberPlate from "./NumberPlate";
-
-import type { SightingType } from "../../types/types";
-
-type SightingProps = {
- sighting: SightingType;
-};
-
-const Sighting = ({ sighting }: SightingProps) => {
- return (
-
- );
-};
-
-export default Sighting;
diff --git a/src/components/PlateStack/Sightings.tsx b/src/components/PlateStack/Sightings.tsx
deleted file mode 100644
index d4db4b6..0000000
--- a/src/components/PlateStack/Sightings.tsx
+++ /dev/null
@@ -1,21 +0,0 @@
-import Card from "../UI/Card";
-import SightingHeader from "./SightingHeader";
-import Sighting from "./Sighting";
-import { useLatestSighting } from "../../hooks/useLatestSighting";
-
-type SightingProps = {
- title: string;
-};
-
-const Sightings = ({ title }: SightingProps) => {
- const { data } = useLatestSighting();
-
- return (
-
-
-
-
- );
-};
-
-export default Sightings;
diff --git a/src/components/SessionForm/HitSearchCard.tsx b/src/components/SessionForm/HitSearchCard.tsx
index 8eab328..151c9bf 100644
--- a/src/components/SessionForm/HitSearchCard.tsx
+++ b/src/components/SessionForm/HitSearchCard.tsx
@@ -1,15 +1,25 @@
import Card from "../UI/Card";
import CardHeader from "../UI/CardHeader";
import FormGroup from "../SettingForms/components/FormGroup";
+import { useAlertHitContext } from "../../context/AlertHitContext";
+import { useState } from "react";
const SessionCard = () => {
+ const [searchTerm, setSearchTerm] = useState("");
+ const { state, disptach } = useAlertHitContext();
+ console.log(state);
return (
);
diff --git a/src/components/SettingForms/BearerType/BearerTypeFields.tsx b/src/components/SettingForms/BearerType/BearerTypeFields.tsx
index 5dee2d4..1985f8f 100644
--- a/src/components/SettingForms/BearerType/BearerTypeFields.tsx
+++ b/src/components/SettingForms/BearerType/BearerTypeFields.tsx
@@ -7,7 +7,7 @@ export const ValuesComponent = () => {
};
const BearerTypeFields = () => {
- const { values } = useFormikContext();
+ useFormikContext();
return (
diff --git a/src/components/SettingForms/WiFi&Modem/ModemCard.tsx b/src/components/SettingForms/WiFi&Modem/ModemCard.tsx
index df88abb..cad048b 100644
--- a/src/components/SettingForms/WiFi&Modem/ModemCard.tsx
+++ b/src/components/SettingForms/WiFi&Modem/ModemCard.tsx
@@ -10,11 +10,17 @@ const ModemCard = () => {
const [authType, setAuthType] = useState("PAP");
return (
+ // TODO: Add switch for Auto vs Manual settings
-
+
{
className="p-2 border border-gray-400 rounded-lg flex-1 md:w-2/3"
placeholder="Enter APN"
value={apn}
- onChange={e => setApn(e.target.value)}
+ onChange={(e) => setApn(e.target.value)}
/>
-
+
{
className="p-2 border border-gray-400 rounded-lg flex-1 md:w-2/3"
placeholder="Enter Username"
value={username}
- onChange={e => setUsername(e.target.value)}
+ onChange={(e) => setUsername(e.target.value)}
/>
-
+
{
className="p-2 border border-gray-400 rounded-lg flex-1 md:w-2/3"
placeholder="Enter Password"
value={password}
- onChange={e => setPassword(e.target.value)}
+ onChange={(e) => setPassword(e.target.value)}
/>
-
+