import clsx from "clsx";
import { SnapshotContainer } from "../CameraOverview/SnapshotContainer";
import Card from "../UI/Card";
import { useNavigate } from "react-router";
import { useSwipeable } from "react-swipeable";

const OverviewVideoContainer = ({
  side,
  settingsPage,
}: {
  title: string;
  side: string;
  settingsPage?: boolean;
}) => {
  const navigate = useNavigate();
  const handlers = useSwipeable({
    onSwipedLeft: () => navigate("/"),
    trackMouse: true,
  });
  return (
    <Card
      className={clsx(
        "relative min-h-[40vh] md:min-h-[60vh] max-h-[80vh] lg:w-[70%] overflow-y-hidden"
      )}
    >
      <div className="w-full" {...handlers}>
        <SnapshotContainer side={side} settingsPage={settingsPage} />
      </div>
    </Card>
  );
};

export default OverviewVideoContainer;
