Files
Mav-Mobile-UI/src/components/FrontCameraSettings/OverviewVideoContainer.tsx

47 lines
1.2 KiB
TypeScript
Raw Normal View History

2025-08-13 14:23:48 +01:00
import clsx from "clsx";
import { SnapshotContainer } from "../CameraOverview/SnapshotContainer";
import Card from "../UI/Card";
import { useNavigate, useLocation } from "react-router";
import { useSwipeable } from "react-swipeable";
2025-08-13 14:23:48 +01:00
const OverviewVideoContainer = ({
side,
2025-08-18 12:53:30 +01:00
settingsPage,
zoomLevel,
onZoomLevelChange,
2025-08-13 14:23:48 +01:00
}: {
title: string;
side: string;
2025-08-18 12:53:30 +01:00
settingsPage?: boolean;
zoomLevel?: number;
onZoomLevelChange?: (level: number) => void;
2025-08-13 14:23:48 +01:00
}) => {
const navigate = useNavigate();
const location = useLocation();
const handlers = useSwipeable({
onSwipedLeft: () => {
if (location.pathname === "/b-camera-settings") return;
navigate("/");
},
onSwipedRight: () => {
if (location.pathname === "/a-camera-settings") return;
navigate("/");
},
trackMouse: true,
});
2025-08-13 14:23:48 +01:00
return (
<Card className={clsx("relative min-h-[40vh] md:min-h-[40vh] max-h-[70vh] lg:w-[70%] overflow-y-hidden")}>
<div className="w-full" {...handlers}>
<SnapshotContainer
side={side}
settingsPage={settingsPage}
zoomLevel={zoomLevel}
onZoomLevelChange={onZoomLevelChange}
/>
2025-08-13 14:23:48 +01:00
</div>
</Card>
);
};
export default OverviewVideoContainer;