@@ -19,6 +19,7 @@ import defaultResultFilters from "../../../constants/default-result-filters";
1919import { SimpleModal } from "../../../elements/simple-modal" ;
2020import { FaSolidIcon } from "../../../types/font-awesome" ;
2121import { IsValidResponse } from "../../../types/validation" ;
22+ import { cn } from "../../../utils/cn" ;
2223import { createErrorMessage } from "../../../utils/error" ;
2324import {
2425 getLanguageDisplayString ,
@@ -141,6 +142,7 @@ export function Filters(props: {
141142 text : string ;
142143 group : T ;
143144 format ?: ( value : K ) => string ;
145+ class ?: string ;
144146 } ) : JSXElement => {
145147 // Isolate this group's data to prevent unnecessary updates
146148 const groupData = createMemo ( ( ) => props . filters [ options . group ] ) ;
@@ -159,7 +161,7 @@ export function Filters(props: {
159161 ) ;
160162
161163 return (
162- < div class = " w-full" >
164+ < div class = { cn ( ` w-full` , options . class ) } >
163165 < H3 fa = { { icon : options . icon , fixedWidth : true } } text = { options . text } />
164166 < SlimSelect
165167 multiple
@@ -320,7 +322,7 @@ export function Filters(props: {
320322 onClick = { ( ) => props . onChangeFilters ( noFilters ( ) ) }
321323 class = "mb-4 w-full"
322324 />
323- < div class = "gap-4 md:grid md:grid-cols-2 [&>div]:last:col-span-2 " >
325+ < div class = "gap-4 md:grid md:grid-cols-2" >
324326 < ButtonGroup text = "difficulty" icon = "fa-star" group = "difficulty" />
325327 < ButtonGroup text = "personal best" icon = "fa-crown" group = "pb" />
326328 < ButtonGroup text = "mode" icon = "fa-bars" group = "mode" />
@@ -350,6 +352,9 @@ export function Filters(props: {
350352 icon = "fa-gamepad"
351353 text = "funbox"
352354 group = "funbox"
355+ class = { cn ( "" , {
356+ "col-span-2" : tags ( ) . length === 0 ,
357+ } ) }
353358 format = { ( val ) =>
354359 val === "none" ? "no funbox" : replaceUnderscoresWithSpaces ( val )
355360 }
@@ -358,6 +363,7 @@ export function Filters(props: {
358363 icon = "fa-globe-americas"
359364 text = "language"
360365 group = "language"
366+ class = "col-span-2"
361367 format = { getLanguageDisplayString }
362368 />
363369 </ div >
0 commit comments