11'use client' ;
22import { getMyActivitiesList } from '@/app/api/myActivities' ;
3- import Spinner from '@/components/common/Spinner' ;
43import ActivitySelect from '@/components/pages/myPage/ActivitySelect' ;
54import ReservationStatusCalendar from '@/components/pages/myPage/ReservationStatusCalendar' ;
65import { Label } from '@/components/ui/label' ;
@@ -10,14 +9,14 @@ import { format } from 'date-fns';
109import { useOverlay } from '@/hooks/useOverlay' ;
1110import { Event as RBCEvent } from 'react-big-calendar' ;
1211import ReservedScheduleModal from '@/components/pages/myPage/ReservedScheduleModal' ;
13- import Image from 'next/image' ;
1412import { useScheduleStore } from '@/store/reservedScheduleStore' ;
1513import { getReservationDashboard } from '@/app/api/myReservations' ;
1614import clsx from 'clsx' ;
15+ import EmptyList from '@/components/pages/myPage/EmptyList' ;
16+ import MypageLoadingOverlay from '@/components/pages/myPage/MypageLoadingOverlay' ;
1717
1818const ReservationStatusPage = ( ) => {
1919 const overlay = useOverlay ( ) ;
20- const [ isInitialLoading , setIsInitialLoading ] = useState ( true ) ;
2120
2221 const { setStatus } = useScheduleStore ( ) ;
2322
@@ -108,18 +107,9 @@ const ReservationStatusPage = () => {
108107 } ;
109108
110109 const ReservationSection = ( ) => {
110+ if ( isActivityListLoading ) return null ;
111111 if ( ! activityListData ?. activities || activityListData ?. activities . length === 0 ) {
112- return (
113- < div className = 'flex flex-col mx-auto' >
114- < Image
115- src = { '/images/icons/_empty.png' }
116- width = { 182 }
117- height = { 182 }
118- alt = '예약 현황 디폴트 이미지'
119- />
120- < span className = 'text-18-medium text-grayscale-600' > 아직 등록한 체험이 없어요</ span >
121- </ div >
122- ) ;
112+ return < EmptyList text = '빈 리스트 이미지' /> ;
123113 }
124114
125115 return (
@@ -141,24 +131,15 @@ const ReservationStatusPage = () => {
141131 ) ;
142132 } ;
143133
144- useEffect ( ( ) => {
145- if ( ! isActivityListLoading && ! isReservationListLoading ) {
146- setIsInitialLoading ( false ) ;
147- }
148- } , [ isActivityListLoading , isReservationListLoading ] ) ;
149-
150134 useEffect ( ( ) => {
151135 if ( activityListData && activityListData ?. activities ?. length > 0 ) {
152136 setActivityId ( String ( activityListData ?. activities [ 0 ] . id ) ) ;
153137 }
154138 } , [ activityListData ] ) ;
155139
156- if ( isInitialLoading ) {
157- return < Spinner /> ;
158- }
159-
160140 return (
161- < div className = 'flex flex-col gap-5 pl-4' >
141+ < div className = 'flex flex-col gap-5 pl-4 relative' >
142+ { ( isActivityListLoading || isReservationListLoading ) && < MypageLoadingOverlay /> }
162143 { /* 헤더 */ }
163144 < div className = 'px-6 sm:px-0 flex flex-col gap-4' >
164145 < div className = 'flex flex-col md:flex-row w-full justify-between items-start md:items-center gap-4 md:gap-16' >
0 commit comments