diff --git a/src/components/CameraSettings/CameraSettingFields.tsx b/src/components/CameraSettings/CameraSettingFields.tsx index c7040bf..d39a4ce 100644 --- a/src/components/CameraSettings/CameraSettingFields.tsx +++ b/src/components/CameraSettings/CameraSettingFields.tsx @@ -5,7 +5,7 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faEye, faEyeSlash } from "@fortawesome/free-regular-svg-icons"; import CardHeader from "../UI/CardHeader"; import { useCameraMode, useCameraZoom } from "../../hooks/useCameraZoom"; -import { parseRTSPUrl, reverseZoomMapping, zoomMapping } from "../../utils/utils"; +import { capitalize, parseRTSPUrl, reverseZoomMapping, zoomMapping } from "../../utils/utils"; type CameraSettingsProps = { initialData: CameraConfig; @@ -181,9 +181,9 @@ const CameraSettingFields = ({
- {["day", "night"].map((el) => ( + {["day", "night", "auto"].map((el) => (
- {el === "day" ? "Day" : "Night"} + {capitalize(el)}
))} diff --git a/src/components/HotlistList/HotlistList.tsx b/src/components/HotlistList/HotlistList.tsx new file mode 100644 index 0000000..2d8f565 --- /dev/null +++ b/src/components/HotlistList/HotlistList.tsx @@ -0,0 +1,67 @@ +import { useHotlistData } from "../../hooks/useHotListData"; +import { useIntegrationsContext } from "../../context/IntegrationsContext"; +import Card from "../UI/Card"; +import CardHeader from "../UI/CardHeader"; +import { toast } from "sonner"; +import { faTrash } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; + +const HotlistList = () => { + const { state, dispatch } = useIntegrationsContext(); + const { mutation } = useHotlistData(); + + const hotlists = state?.hotlistFiles; + + const handleDeleteClick = async (filename: string) => { + await mutation.mutateAsync(filename); + dispatch({ type: "DELETEHOTLIST", payload: filename }); + toast.success(`${filename} successfully deleted`); + }; + + return ( + + + {hotlists?.length > 0 ? ( +
    + {hotlists?.map((hotlist) => ( +
  • +
    +

    {hotlist.filename}

    +
    +
    +

    + Number of records: {hotlist.rowCount} +

    +
    +
    +

    + File Size (bytes): {hotlist.fileSizeBytes} +

    +
    +
    +
    + + +
  • + ))} +
+ ) : ( +
+
+ No Uploaded Hotlists +
+

+ Hotlists will appear here once there are uploaded. +

+
+ )} +
+ ); +}; + +export default HotlistList; diff --git a/src/components/SessionForm/SessionCard.tsx b/src/components/SessionForm/SessionCard.tsx index d77931b..a79a9c7 100644 --- a/src/components/SessionForm/SessionCard.tsx +++ b/src/components/SessionForm/SessionCard.tsx @@ -4,7 +4,7 @@ import { useIntegrationsContext } from "../../context/IntegrationsContext"; 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 { faFloppyDisk, faPause, faPlay, faStop, faArrowRotateRight } from "@fortawesome/free-solid-svg-icons"; import VehicleSessionItem from "../UI/VehicleSessionItem"; import { useCameraBlackboard } from "../../hooks/useCameraBlackboard"; @@ -70,6 +70,21 @@ const SessionCard = () => { if (result.reason === "OK") toast.success("Session saved"); }; + const handleRestartClick = async () => { + const result = await mutation.mutateAsync({ + operation: "INSERT", + path: "sessionStats", + value: [], + }); + await mutation.mutateAsync({ + operation: "SAVE", + path: "", + value: null, + }); + if (result.reason === "OK") toast.success("Session restarted"); + dispatch({ type: "SESSIONRESTART", payload: [] }); + }; + return ( @@ -85,6 +100,17 @@ const SessionCard = () => {

{sessionStarted ? "End Session" : "Start Session"}

+ {sessionStarted && ( + + )}
{sessionStarted && (