@@ -2920,47 +2920,43 @@ export const offlineApi = {
29202920
29212921 // Map category to icon
29222922 const getIcon = ( cat ) => {
2923- const lower = normalizeText ( cat || '' ) . toLowerCase ( ) ;
2924- console . log ( 'DEBUG ICON:' , cat , '->' , lower ) ;
2925- // Explicit English Mapping (High Priority)
2926- if ( lower . includes ( 'technology' ) || lower . includes ( 'data' ) || lower . includes ( 'it' ) ) return 'tech.svg' ;
2927- if ( lower . includes ( 'education' ) ) return 'education.svg' ;
2928- if ( lower . includes ( 'health' ) || lower . includes ( 'medical' ) || lower . includes ( 'doctor' ) ) return 'health.svg' ;
2929- if ( lower . includes ( 'business' ) || lower . includes ( 'finance' ) || lower . includes ( 'marketing' ) || lower . includes ( 'sales' ) ) return 'business.svg' ;
2930- if ( lower . includes ( 'creative' ) || lower . includes ( 'design' ) || lower . includes ( 'art' ) || lower . includes ( 'media' ) ) return 'creative.svg' ;
2931- if ( lower . includes ( 'science' ) ) return 'science.svg' ;
2932- if ( lower . includes ( 'security' ) ) return 'security.svg' ;
2933- if ( lower . includes ( 'service' ) || lower . includes ( 'beauty' ) || lower . includes ( 'retail' ) ) return 'service.svg' ;
2934- if ( lower . includes ( 'hospitality' ) || lower . includes ( 'hotel' ) || lower . includes ( 'tourism' ) ) return 'hospitality.svg' ;
2935- if ( lower . includes ( 'transport' ) || lower . includes ( 'logistics' ) ) return 'transport.svg' ;
2936- if ( lower . includes ( 'construction' ) || lower . includes ( 'architecture' ) ) return 'construction.svg' ;
2937- if ( lower . includes ( 'agriculture' ) || lower . includes ( 'farming' ) || lower . includes ( 'agri' ) ) return 'agri.svg' ;
2938- if ( lower . includes ( 'management' ) || lower . includes ( 'manager' ) ) return 'management.svg' ;
2939- if ( lower . includes ( 'legal' ) || lower . includes ( 'law' ) ) return 'legal.svg' ;
2940- if ( lower . includes ( 'admin' ) || lower . includes ( 'government' ) || lower . includes ( 'office' ) ) return 'admin.svg' ;
2941- if ( lower . includes ( 'community' ) || lower . includes ( 'social' ) || lower . includes ( 'sports' ) ) return 'community.svg' ;
2942- if ( lower . includes ( 'engineering' ) || lower . includes ( 'industry' ) || lower . includes ( 'technical' ) || lower . includes ( 'trades' ) ) return 'engineering.svg' ;
2943-
2944- // Vietnamese Mapping (Fallback)
2945- if ( lower . includes ( 'cong nghe' ) ) return 'tech.svg' ;
2946- if ( lower . includes ( 'giao duc' ) ) return 'education.svg' ;
2947- if ( lower . includes ( 'y te' ) || lower . includes ( 'bac si' ) ) return 'health.svg' ;
2948- if ( lower . includes ( 'kinh doanh' ) ) return 'business.svg' ;
2949- if ( lower . includes ( 'nghe thuat' ) || lower . includes ( 'thiet ke' ) ) return 'creative.svg' ;
2950- if ( lower . includes ( 'khoa hoc' ) ) return 'science.svg' ;
2951- if ( lower . includes ( 'an ninh' ) ) return 'security.svg' ;
2952- if ( lower . includes ( 'dich vu' ) ) return 'service.svg' ;
2953- if ( lower . includes ( 'du lich' ) ) return 'hospitality.svg' ;
2954- if ( lower . includes ( 'van tai' ) ) return 'transport.svg' ;
2955- if ( lower . includes ( 'xay dung' ) ) return 'construction.svg' ;
2956- if ( lower . includes ( 'nong nghiep' ) ) return 'agri.svg' ;
2957- if ( lower . includes ( 'quan ly' ) ) return 'management.svg' ;
2958- if ( lower . includes ( 'luat' ) ) return 'legal.svg' ;
2959- if ( lower . includes ( 'hanh chinh' ) ) return 'admin.svg' ;
2960- if ( lower . includes ( 'cong dong' ) ) return 'community.svg' ;
2961- if ( lower . includes ( 'ky thuat' ) || lower . includes ( 'co khi' ) ) return 'engineering.svg' ;
2962-
2963- return 'default.svg' ;
2923+ const key = normalizeText ( cat || '' ) . toLowerCase ( ) . trim ( ) ;
2924+
2925+ const MAPPING = {
2926+ 'agriculture' : 'agri.svg' ,
2927+ 'beauty' : 'service.svg' ,
2928+ 'business' : 'business.svg' ,
2929+ 'construction' : 'construction.svg' ,
2930+ 'data' : 'tech.svg' ,
2931+ 'design' : 'creative.svg' ,
2932+ 'education' : 'education.svg' ,
2933+ 'engineering' : 'engineering.svg' ,
2934+ 'finance' : 'business.svg' ,
2935+ 'government' : 'admin.svg' ,
2936+ 'healthcare' : 'health.svg' ,
2937+ 'health' : 'health.svg' ,
2938+ 'hospitality' : 'hospitality.svg' ,
2939+ 'legal' : 'legal.svg' ,
2940+ 'logistics' : 'transport.svg' ,
2941+ 'marketing' : 'business.svg' ,
2942+ 'media' : 'creative.svg' ,
2943+ 'realestate' : 'business.svg' ,
2944+ 'retail' : 'service.svg' ,
2945+ 'science' : 'science.svg' ,
2946+ 'sports' : 'community.svg' ,
2947+ 'technology' : 'tech.svg' ,
2948+ 'tech' : 'tech.svg' ,
2949+ 'trades' : 'engineering.svg' ,
2950+ 'transportation' : 'transport.svg' ,
2951+ 'transport' : 'transport.svg' ,
2952+ 'security' : 'security.svg' ,
2953+ 'service' : 'service.svg' ,
2954+ 'management' : 'management.svg' ,
2955+ 'community' : 'community.svg' ,
2956+ 'admin' : 'admin.svg'
2957+ } ;
2958+
2959+ return MAPPING [ key ] || 'default.svg' ;
29642960 } ;
29652961
29662962 const query = normalizeText ( String ( q || '' ) ) ;
0 commit comments