diff --git a/frontend/src/components/ui/StationList/StationList.tsx b/frontend/src/components/ui/StationList/StationList.tsx
index 90f427e66..3e5c53c1d 100644
--- a/frontend/src/components/ui/StationList/StationList.tsx
+++ b/frontend/src/components/ui/StationList/StationList.tsx
@@ -1,9 +1,14 @@
import { css } from 'styled-components';
+import { useEffect, useRef } from 'react';
+
+import { debounce } from '@utils/debounce';
+
import { useStationMarkers } from '@hooks/tanstack-query/station-markers/useStationMarkers';
-import ButtonNext from '@common/ButtonNext';
+import FlexBox from '@common/FlexBox';
import List from '@common/List';
+import Text from '@common/Text';
import EmptyStationsNotice from '@ui/StationList/EmptyStationsNotice';
import StationSummaryCardSkeleton from '@ui/StationList/StationSummaryCardSkeleton';
@@ -27,6 +32,29 @@ const StationList = () => {
hasNextPage,
} = useFetchStationSummaries(filteredMarkers ?? []);
+ const loadMoreElementRef = useRef(null);
+ const loadMoreAfterDebounce = debounce(loadMore, 500);
+
+ useEffect(() => {
+ const observer = new IntersectionObserver((entries) => {
+ entries.forEach((entry) => {
+ if (entry.isIntersecting && hasNextPage) {
+ loadMoreAfterDebounce();
+ }
+ });
+ });
+
+ if (loadMoreElementRef.current) {
+ observer.observe(loadMoreElementRef.current);
+ }
+
+ return () => {
+ if (loadMoreElementRef.current) {
+ observer.unobserve(loadMoreElementRef.current);
+ }
+ };
+ }, [loadMore, hasNextPage]);
+
const cachedStationSummaries = cachedStationSummariesActions.get();
if (isFilteredMarkersLoading) {
@@ -61,10 +89,12 @@ const StationList = () => {
))}
>
)}
- {hasNextPage && (
-