diff --git a/src/components/SessionForm/SessionCard.tsx b/src/components/SessionForm/SessionCard.tsx index ffdc3aa..588bc07 100644 --- a/src/components/SessionForm/SessionCard.tsx +++ b/src/components/SessionForm/SessionCard.tsx @@ -5,19 +5,26 @@ import type { ReducedSightingType } from "../../types/types"; import { toast } from "sonner"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faFloppyDisk, faPause, faPlay, faStop } from "@fortawesome/free-solid-svg-icons"; +import VehicleSessionItem from "../UI/VehicleSessionItem"; const SessionCard = () => { - const { sessionStarted, setSessionStarted, sessionList } = useNPEDContext(); + const { sessionStarted, setSessionStarted, sessionList, setSessionPaused, sessionPaused } = useNPEDContext(); const handleStartClick = () => { setSessionStarted(!sessionStarted); - toast(`${sessionStarted ? "Vehicle tracking session Ended" : "Vehicle tracking session Started"}`); + setSessionPaused(false); + toast(`${sessionStarted ? "Vehicle tracking session ended" : "Vehicle tracking session started"}`); }; const handleSaveCick = () => { console.log("clicked"); }; + const handlepauseClick = () => { + setSessionPaused(!sessionPaused); + toast(`${sessionStarted ? "Vehicle tracking session paused" : "Vehicle tracking session resumed"}`); + }; + const sightings = [...new Map(sessionList.map((vehicle) => [vehicle.vrm, vehicle]))]; const dedupedSightings = sightings.map((sighting) => sighting[1]); @@ -75,45 +82,52 @@ const SessionCard = () => { {sessionStarted && ( )}
Number of Vehicles sightings:
- {dedupedSightings.length} -Vehicles without Tax:
- {vehicles.notTaxed.length} -Vehicles without MOT:
{" "} - {vehicles.notMOT.length} -Vehicles on Hotlists:
{" "} - {vehicles.hotlistHit.length} -Vehicles with NPED Cat A:
- {vehicles.npedCatA.length} -Vehicles with NPED Cat B:
{" "} - {vehicles.npedCatB.length} -Session Paused
+ ) : ( + sessionStarted &&Session Active
+ )} +{vehicleTag}
+ {sessionNumber} +