Add on click from main dashboard

This commit is contained in:
Nicolas Mowen 2024-03-15 14:19:15 -06:00
parent 2ae7835590
commit a199569b8a
2 changed files with 4 additions and 0 deletions

View File

@ -9,12 +9,14 @@ type LivePlayerProps = {
className?: string;
birdseyeConfig: BirdseyeConfig;
liveMode: LivePlayerMode;
onClick?: () => void;
};
export default function BirdseyeLivePlayer({
className,
birdseyeConfig,
liveMode,
onClick,
}: LivePlayerProps) {
let player;
if (liveMode == "webrtc") {
@ -50,6 +52,7 @@ export default function BirdseyeLivePlayer({
return (
<div
className={`relative flex justify-center w-full cursor-pointer ${className ?? ""}`}
onClick={onClick}
>
<div className="absolute top-0 inset-x-0 rounded-2xl z-10 w-full h-[30%] bg-gradient-to-b from-black/20 to-transparent pointer-events-none"></div>
<div className="absolute bottom-0 inset-x-0 rounded-2xl z-10 w-full h-[10%] bg-gradient-to-t from-black/20 to-transparent pointer-events-none"></div>

View File

@ -134,6 +134,7 @@ export default function LiveDashboardView({
<BirdseyeLivePlayer
birdseyeConfig={birdseyeConfig}
liveMode={birdseyeConfig.restream ? "mse" : "jsmpeg"}
onClick={() => onSelectCamera("birdseye")}
/>
)}
{cameras.map((camera) => {