diff --git a/frontend/src/pages/Snapshot.tsx b/frontend/src/pages/Snapshot.tsx index 1fc8c25..eb422e2 100644 --- a/frontend/src/pages/Snapshot.tsx +++ b/frontend/src/pages/Snapshot.tsx @@ -5,10 +5,11 @@ import DefaultLayout from '../layout/DefaultLayout'; const Snapshot: React.FC = () => { const [imageUrls, setImageUrls] = useState([]); + const [selectedInterval, setSelectedInterval] = useState('week'); useEffect(() => { const fetchUrls = async () => { - const urls = await fetchCameraSnapshotUrls('week'); + const urls = await fetchCameraSnapshotUrls(selectedInterval); if (urls) { setImageUrls(urls); } else { @@ -17,12 +18,58 @@ const Snapshot: React.FC = () => { }; fetchUrls(); - }, []); + }, [selectedInterval]); + + const handleIntervalChange = (interval: string) => { + setSelectedInterval(interval); + }; return (
+
+ + + + +
{imageUrls.map((url, index) => (