refactor: NPED Context, sound update and start session

This commit is contained in:
2025-09-25 10:38:49 +01:00
parent efd037754e
commit 80b407943f
20 changed files with 96 additions and 39 deletions

View File

@@ -1,12 +1,13 @@
import { useSound } from "react-sounds";
import Card from "../UI/Card";
import CardHeader from "../UI/CardHeader";
import { useNPEDContext } from "../../context/NPEDUserContext";
const SessionCard = () => {
const { play } = useSound("notification/notification");
// function onStart(): void {
// throw new Error("Function not implemented.");
// }
const { sessionStarted, setSessionStarted, sessionList } = useNPEDContext();
const handleStartClick = () => {
setSessionStarted(!sessionStarted);
};
return (
<Card>
@@ -14,15 +15,13 @@ const SessionCard = () => {
<div className="flex flex-col gap-4">
<button
className="bg-[#26B170] text-white px-4 py-2 rounded hover:bg-green-700 transition w-full"
onClick={() => {
play();
}}
onClick={handleStartClick}
>
Start Session
</button>
<ul className="text-white space-y-2">
<li>Number of Vehicles: </li>
<li>Number of Vehicles: {sessionList.length} </li>
<li>Vehicles without Tax: </li>
<li>Vehicles without MOT: </li>
<li>Vehicles with NPED Cat A: </li>