11"use client" ;
22
3+ import { Suspense } from "react" ;
4+
35import { useSearchParams } from "next/navigation" ;
46
57import Header from "@/components/common/Header" ;
@@ -26,7 +28,7 @@ function getErrorMessage(error: unknown) {
2628 return error instanceof Error ? error . message : "전시 현황을 불러오지 못했습니다." ;
2729}
2830
29- export default function ExhibitionStatusPage ( ) {
31+ function ExhibitionStatusContent ( ) {
3032 const searchParams = useSearchParams ( ) ;
3133 const { isAuthReady, isAuthenticated } = useRequireAuth ( ) ;
3234
@@ -36,18 +38,39 @@ export default function ExhibitionStatusPage() {
3638 const isLoading = ! isAuthReady || ( isAuthenticated && query . isLoading ) ;
3739 const errorMessage = query . error ? getErrorMessage ( query . error ) : null ;
3840
41+ return (
42+ < main className = "mx-auto min-h-[calc(100dvh-60px)] w-full max-w-97.5 min-w-[320px]" >
43+ < StatusFilterTabs activeFilter = { activeFilter } />
44+ < ExhibitionStatusList
45+ exhibitions = { exhibitions }
46+ isLoading = { isLoading }
47+ errorMessage = { isAuthenticated ? errorMessage : null }
48+ onRetry = { ( ) => void query . refetch ( ) }
49+ />
50+ </ main >
51+ ) ;
52+ }
53+
54+ function ExhibitionStatusFallback ( ) {
55+ return (
56+ < main className = "mx-auto min-h-[calc(100dvh-60px)] w-full max-w-97.5 min-w-[320px]" >
57+ < ExhibitionStatusList
58+ exhibitions = { [ ] }
59+ isLoading
60+ errorMessage = { null }
61+ onRetry = { ( ) => undefined }
62+ />
63+ </ main >
64+ ) ;
65+ }
66+
67+ export default function ExhibitionStatusPage ( ) {
3968 return (
4069 < div className = "bg-bg-primary min-h-dvh" >
4170 < Header title = "전시 현황" showBorder = { false } />
42- < main className = "mx-auto min-h-[calc(100dvh-60px)] w-full max-w-97.5 min-w-[320px]" >
43- < StatusFilterTabs activeFilter = { activeFilter } />
44- < ExhibitionStatusList
45- exhibitions = { exhibitions }
46- isLoading = { isLoading }
47- errorMessage = { isAuthenticated ? errorMessage : null }
48- onRetry = { ( ) => void query . refetch ( ) }
49- />
50- </ main >
71+ < Suspense fallback = { < ExhibitionStatusFallback /> } >
72+ < ExhibitionStatusContent />
73+ </ Suspense >
5174 </ div >
5275 ) ;
5376}
0 commit comments