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";
|
2025-08-15 09:32:33 +01:00
|
|
|
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";
|
2025-09-23 13:03:54 +01:00
|
|
|
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,
|
|
|
|
|
});
|
2025-09-23 13:03:54 +01:00
|
|
|
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}>
|
2025-09-23 13:03:54 +01:00
|
|
|
<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;
|