Files
Mav-Mobile-UI/src/components/RearCameraOverview/RearCameraOverviewCard.tsx

40 lines
1.2 KiB
TypeScript
Raw Normal View History

2025-08-13 14:23:48 +01:00
import clsx from "clsx";
import Card from "../UI/Card";
2025-08-22 10:38:28 +01:00
// import { SnapshotContainer } from "../CameraOverview/SnapshotContainer";
2025-08-13 14:23:48 +01:00
import { useSwipeable } from "react-swipeable";
import { useNavigate } from "react-router";
import CardHeader from "../UI/CardHeader";
import { faCamera } from "@fortawesome/free-regular-svg-icons";
2025-08-22 10:38:28 +01:00
import SightingOverview from "../SightingOverview/SightingOverview";
import { useSightingFeedContext } from "../../context/SightingFeedContext";
2025-08-13 14:23:48 +01:00
2025-08-20 08:27:05 +01:00
type CardProps = React.HTMLAttributes<HTMLDivElement>;
const RearCameraOverviewCard = ({ className }: CardProps) => {
2025-08-13 14:23:48 +01:00
const navigate = useNavigate();
const handlers = useSwipeable({
onSwipedLeft: () => navigate("/rear-camera-settings"),
trackMouse: true,
});
const { mostRecent } = useSightingFeedContext();
2025-08-13 14:23:48 +01:00
return (
2025-08-22 10:38:28 +01:00
<Card
className={clsx(
"relative min-h-[40vh] md:min-h-[60vh] h-auto",
className
)}
>
2025-08-13 14:23:48 +01:00
<div className="flex flex-col space-y-3 h-full" {...handlers}>
<CardHeader
title="Rear Overview"
icon={faCamera}
sighting={mostRecent}
/>
2025-08-22 10:38:28 +01:00
<SightingOverview />
2025-08-13 14:23:48 +01:00
</div>
</Card>
);
};
export default RearCameraOverviewCard;