@@ -46,12 +46,18 @@ const SessionItem: React.FC<{ session: BackendAPISchemas.SessionSchema }> = Susp
4646 ) ;
4747} ) ;
4848
49- export const SessionList : React . FC = ErrorBoundary . with (
49+ type SessionListPropType = {
50+ event ?: string ;
51+ types ?: string [ ] ;
52+ } ;
53+
54+ export const SessionList : React . FC < SessionListPropType > = ErrorBoundary . with (
5055 { fallback : ErrorFallback } ,
51- Suspense . with ( { fallback : < CircularProgress /> } , ( ) => {
56+ Suspense . with ( { fallback : < CircularProgress /> } , ( { event , types } ) => {
5257 const { language } = Hooks . Common . useCommonContext ( ) ;
5358 const backendAPIClient = Hooks . BackendAPI . useBackendClient ( ) ;
54- const { data : sessions } = Hooks . BackendAPI . useSessionsQuery ( backendAPIClient ) ;
59+ const params = { ...( event && { event } ) , ...( types && { types } ) } ;
60+ const { data : sessions } = Hooks . BackendAPI . useSessionsQuery ( backendAPIClient , params ) ;
5561
5662 const warningMessage =
5763 language === "ko"
@@ -80,17 +86,21 @@ export const SessionList: React.FC = ErrorBoundary.with(
8086 < Box >
8187 < Typography variant = "body2" sx = { { width : "100%" , textAlign : "right" , my : 0.5 , fontSize : "0.6rem" } } children = { warningMessage } />
8288 < StyledDivider />
83- < Stack direction = "row" sx = { { flexWrap : "wrap" , justifyContent : "center" , gap : "0.1rem 0.2rem" , my : 1 } } >
84- { categories . map ( ( cat ) => (
85- < CategoryButtonStyle
86- key = { cat . id }
87- onClick = { ( ) => toggleCategory ( cat . id ) }
88- children = { cat . name }
89- selected = { selectedCategoryIds . some ( ( selectedCatId ) => selectedCatId === cat . id ) }
90- />
91- ) ) }
92- </ Stack >
93- < StyledDivider />
89+ { categories && (
90+ < >
91+ < Stack direction = "row" sx = { { flexWrap : "wrap" , justifyContent : "center" , gap : "0.1rem 0.2rem" , my : 1 } } >
92+ { categories . map ( ( cat ) => (
93+ < CategoryButtonStyle
94+ key = { cat . id }
95+ onClick = { ( ) => toggleCategory ( cat . id ) }
96+ children = { cat . name }
97+ selected = { selectedCategoryIds . some ( ( selectedCatId ) => selectedCatId === cat . id ) }
98+ />
99+ ) ) }
100+ </ Stack >
101+ < StyledDivider />
102+ </ >
103+ ) }
94104 </ Box >
95105 { filteredSessions . map ( ( s ) => (
96106 < SessionItem key = { s . id } session = { s } />
0 commit comments