updated preview camera view and removed NPED alert disptach

This commit is contained in:
2025-09-19 10:55:36 +01:00
parent 9a56392876
commit 047251756e
4 changed files with 30 additions and 29 deletions

2
.env
View File

@@ -10,3 +10,5 @@ VITE_AGX_BOX_REAR_URL=http://192.168.0.90:8080/SightingListRear/sightingSummary?
VITE_AGX=http://100.72.72.70:8080/SightingListRear/sightingSummary?mostRecentRef=
VITE_AGX_FRONT=http://100.72.72.70:8080/SightingListFront/sightingSummary?mostRecentRef=
VITE_AGX_FRONT_BASE=http://100.72.72.70:8080/

View File

@@ -43,18 +43,21 @@ const SightingModal = ({
Sighting Details
</h2>
</div>
<div className="flex flex-col md:flex-row gap-3 items-center mb-2">
<NumberPlate vrm={sighting?.vrm} motion={motionAway} />
<img
src={sighting?.plateUrlColour}
alt="plate patch"
className="h-16 object-contain rounded-md"
/>
<div className="flex flex-col md:flex-row gap-3 items-center mb-2 justify-between">
<div className="flex flex-col md:flex-row gap-3 items-center">
<NumberPlate vrm={sighting?.vrm} motion={motionAway} />
<img
src={sighting?.plateUrlColour}
alt="plate patch"
className="h-16 object-contain rounded-md"
/>
</div>
{isHotListHit && (
<img
src={HotListImg}
alt="hotlistHit"
className="h-18 object-contain rounded-md"
className="h-20 object-contain rounded-md"
/>
)}
</div>

View File

@@ -7,7 +7,7 @@ import CardHeader from "../UI/CardHeader";
import clsx from "clsx";
import { useSightingFeedContext } from "../../context/SightingFeedContext";
import SightingModal from "../SightingModal/SightingModal";
import { useAlertHitContext } from "../../context/AlertHitContext";
// import { useAlertHitContext } from "../../context/AlertHitContext";
import InfoBar from "./InfoBar";
function useNow(tickMs = 1000) {
@@ -44,7 +44,7 @@ export default function SightingHistoryWidget({
selectedSighting,
} = useSightingFeedContext();
const { dispatch } = useAlertHitContext();
// const { dispatch } = useAlertHitContext();
const hasAutoOpenedRef = useRef(false);
@@ -62,18 +62,18 @@ export default function SightingHistoryWidget({
[sightings]
);
useEffect(() => {
rows?.forEach((obj) => {
const isNPEDHit = obj?.metadata?.npedJSON?.status_code === 404;
// useEffect(() => {
// rows?.forEach((obj) => {
// const isNPEDHit = obj?.metadata?.npedJSON?.status_code === 404;
if (isNPEDHit) {
dispatch({
type: "ADD",
payload: obj,
});
}
});
}, [rows, dispatch]);
// if (isNPEDHit) {
// dispatch({
// type: "ADD",
// payload: obj,
// });
// }
// });
// }, [rows, dispatch]);
useEffect(() => {
if (hasAutoOpenedRef.current) return;

View File

@@ -1,14 +1,10 @@
import { useRef, useCallback, useEffect } from "react";
import { useQuery } from "@tanstack/react-query";
const apiUrl = import.meta.env.VITE_BASEURL;
const folkstoneUrl = import.meta.env.VITE_FOLKESTONE_BASE;
console.log(folkstoneUrl);
const apiUrl = import.meta.env.VITE_AGX_FRONT_BASE;
async function fetchSnapshot(cameraSide: string) {
const response = await fetch(
// `${folkstoneUrl}/Colour-preview`
`${apiUrl}/${cameraSide}-preview`
);
const response = await fetch(`${apiUrl}/${cameraSide}-preview`);
if (!response.ok) {
throw new Error("Cannot reach endpoint");
}