@@ -96,7 +96,9 @@ export const TutorialsShowcase: React.FC<TutorialsShowcaseProps> = ({
9696 } , [ tutorials , services ] ) ;
9797
9898 const uniquePlatforms = useMemo ( ( ) => {
99- const allPlatforms = new Set ( tutorials . flatMap ( tutorial => tutorial . platform ) ) ;
99+ const allPlatforms = new Set ( tutorials . flatMap ( tutorial =>
100+ tutorial . platform . map ( p => p . toLowerCase ( ) ) // Convert to lowercase
101+ ) ) ;
100102 return Array . from ( allPlatforms ) . sort ( ( a , b ) => ( platforms [ a ] || a ) . localeCompare ( platforms [ b ] || b ) ) ;
101103 } , [ tutorials , platforms ] ) ;
102104
@@ -121,7 +123,7 @@ export const TutorialsShowcase: React.FC<TutorialsShowcaseProps> = ({
121123
122124 // Other filters
123125 if ( filters . services . length > 0 && ! filters . services . some ( service => tutorial . services . includes ( service ) ) ) return false ;
124- if ( filters . platforms . length > 0 && ! filters . platforms . some ( platform => tutorial . platform . includes ( platform ) ) ) return false ;
126+ if ( filters . platforms . length > 0 && ! filters . platforms . some ( platform => tutorial . platform . map ( p => p . toLowerCase ( ) ) . includes ( platform ) ) ) return false ;
125127 if ( filters . deployments . length > 0 && ! filters . deployments . some ( deployment => tutorial . deployment . includes ( deployment ) ) ) return false ;
126128 if ( filters . showProOnly && ! tutorial . pro ) return false ;
127129
@@ -510,7 +512,10 @@ export const TutorialsShowcase: React.FC<TutorialsShowcaseProps> = ({
510512
511513 < select
512514 value = { filters . services [ 0 ] || '' }
513- onChange = { ( e ) => e . target . value ? toggleFilter ( 'services' , e . target . value ) : null }
515+ onChange = { ( e ) => setFilters ( prev => ( {
516+ ...prev ,
517+ services : e . target . value ? [ e . target . value ] : [ ]
518+ } ) ) }
514519 className = "filter-select"
515520 >
516521 < option value = "" > Services</ option >
@@ -523,7 +528,10 @@ export const TutorialsShowcase: React.FC<TutorialsShowcaseProps> = ({
523528
524529 < select
525530 value = { filters . platforms [ 0 ] || '' }
526- onChange = { ( e ) => e . target . value ? toggleFilter ( 'platforms' , e . target . value ) : null }
531+ onChange = { ( e ) => setFilters ( prev => ( {
532+ ...prev ,
533+ platforms : e . target . value ? [ e . target . value ] : [ ]
534+ } ) ) }
527535 className = "filter-select"
528536 >
529537 < option value = "" > Languages</ option >
@@ -536,7 +544,10 @@ export const TutorialsShowcase: React.FC<TutorialsShowcaseProps> = ({
536544
537545 < select
538546 value = { filters . deployments [ 0 ] || '' }
539- onChange = { ( e ) => e . target . value ? toggleFilter ( 'deployments' , e . target . value ) : null }
547+ onChange = { ( e ) => setFilters ( prev => ( {
548+ ...prev ,
549+ deployments : e . target . value ? [ e . target . value ] : [ ]
550+ } ) ) }
540551 className = "filter-select"
541552 >
542553 < option value = "" > Deployment</ option >
0 commit comments