@@ -28,7 +28,7 @@ export function ShowcaseGallery() {
2828 pageSize : 24 ,
2929 } ,
3030 filters : {
31- libraryId : search . libraryId ,
31+ libraryIds : search . libraryIds ,
3232 useCases : search . useCases as ShowcaseUseCase [ ] ,
3333 q : search . q ,
3434 } ,
@@ -67,7 +67,7 @@ export function ShowcaseGallery() {
6767 getApprovedShowcasesQueryOptions ( {
6868 pagination : { page : search . page , pageSize : 24 } ,
6969 filters : {
70- libraryId : search . libraryId ,
70+ libraryIds : search . libraryIds ,
7171 useCases : search . useCases as ShowcaseUseCase [ ] ,
7272 q : search . q ,
7373 } ,
@@ -111,7 +111,7 @@ export function ShowcaseGallery() {
111111 getApprovedShowcasesQueryOptions ( {
112112 pagination : { page : search . page , pageSize : 24 } ,
113113 filters : {
114- libraryId : search . libraryId ,
114+ libraryIds : search . libraryIds ,
115115 useCases : search . useCases as ShowcaseUseCase [ ] ,
116116 q : search . q ,
117117 } ,
@@ -152,7 +152,7 @@ export function ShowcaseGallery() {
152152 getApprovedShowcasesQueryOptions ( {
153153 pagination : { page : search . page , pageSize : 24 } ,
154154 filters : {
155- libraryId : search . libraryId ,
155+ libraryIds : search . libraryIds ,
156156 useCases : search . useCases as ShowcaseUseCase [ ] ,
157157 q : search . q ,
158158 } ,
@@ -182,11 +182,25 @@ export function ShowcaseGallery() {
182182 voteMutation . mutate ( { showcaseId, value } )
183183 }
184184
185- const handleLibraryFilter = ( libraryId : string | undefined ) => {
185+ const handleLibraryToggle = ( libraryId : string ) => {
186+ const current = search . libraryIds || [ ]
187+ const updated = current . includes ( libraryId )
188+ ? current . filter ( ( id : string ) => id !== libraryId )
189+ : [ ...current , libraryId ]
186190 navigate ( {
187191 search : ( prev : typeof search ) => ( {
188192 ...prev ,
189- libraryId,
193+ libraryIds : updated . length > 0 ? updated : undefined ,
194+ page : 1 ,
195+ } ) ,
196+ } )
197+ }
198+
199+ const clearLibraries = ( ) => {
200+ navigate ( {
201+ search : ( prev : typeof search ) => ( {
202+ ...prev ,
203+ libraryIds : undefined ,
190204 page : 1 ,
191205 } ) ,
192206 } )
@@ -236,15 +250,15 @@ export function ShowcaseGallery() {
236250 navigate ( {
237251 search : {
238252 page : 1 ,
239- libraryId : undefined ,
253+ libraryIds : undefined ,
240254 useCases : undefined ,
241255 q : undefined ,
242256 } ,
243257 } )
244258 }
245259
246260 const hasFilters =
247- search . libraryId ||
261+ ( search . libraryIds && search . libraryIds . length > 0 ) ||
248262 ( search . useCases && search . useCases . length > 0 ) ||
249263 search . q
250264
@@ -279,11 +293,12 @@ export function ShowcaseGallery() {
279293 < div className = "max-w-7xl mx-auto px-4 py-3" >
280294 < ShowcaseTopBarFilters
281295 filters = { {
282- libraryId : search . libraryId ,
296+ libraryIds : search . libraryIds ,
283297 useCases : search . useCases as ShowcaseUseCase [ ] ,
284298 q : search . q ,
285299 } }
286- onLibraryChange = { handleLibraryFilter }
300+ onLibraryToggle = { handleLibraryToggle }
301+ onClearLibraries = { clearLibraries }
287302 onUseCaseToggle = { handleUseCaseFilter }
288303 onClearUseCases = { clearUseCases }
289304 onClearFilters = { clearFilters }
0 commit comments