Only show the red dot when camera is recording

This commit is contained in:
Nicolas Mowen 2024-02-09 05:47:56 -07:00
parent a004890a7e
commit f74092a10e

View File

@ -15,6 +15,7 @@ import { MdCircle, MdLeakAdd, MdSelectAll } from "react-icons/md";
import { BsSoundwave } from "react-icons/bs";
import Chip from "../Chip";
import useCameraActivity from "@/hooks/use-camera-activity";
import { useRecordingsState } from "@/api/ws";
const emptyObject = Object.freeze({});
@ -52,6 +53,8 @@ export default function LivePlayer({
}
}, [activeMotion, activeTracking, liveReady]);
const { payload: recording } = useRecordingsState(cameraConfig.name);
// debug view settings
const [showSettings, setShowSettings] = useState(false);
@ -216,9 +219,7 @@ export default function LivePlayer({
</div>
)}
<Chip className="absolute right-2 top-2 bg-gray-500 bg-gradient-to-br">
{cameraConfig.record.enabled && (
<MdCircle className="w-2 h-2 text-danger" />
)}
{recording == "ON" && <MdCircle className="w-2 h-2 text-danger" />}
<div className="ml-1 capitalize text-white text-xs">
{cameraConfig.name.replaceAll("_", " ")}
</div>