\r\n { loading ? (\r\n
{ __( 'Loading...', 'cg-jobs' ) }
\r\n ) : (\r\n ((filterOptions && filterOptions.every(obj => Array.isArray(obj.item) && obj.item.length !== 0))) ? (\r\n <>\r\n
\r\n
{ __( 'Filters', 'cg-jobs' ) }
\r\n {Object.entries(selectedFilters).some(([key, set]) => (key !== \"country_code\" && set.size > 0)) && }\r\n \r\n\r\n {filterOptions && filterOptions.map(singleFilter => ( \r\n (singleFilter.type && singleFilter.type !== \"\" && visibleFilters.includes(singleFilter.type) && singleFilter.item.length > 0) && \r\n
\r\n
\r\n
{(() => {\r\n switch (singleFilter.type) {\r\n case 'professional_communities':\r\n return 'Professions';\r\n case 'brand':\r\n return 'Brands';\r\n default:\r\n return singleFilter.type.charAt(0).toUpperCase() + singleFilter.type.slice(1).replace(/_/g, ' ');\r\n }\r\n })()}
\r\n \r\n \r\n
\r\n \r\n {singleFilter.item && singleFilter.item.sort((a,b) => b.count - a.count).map(childItem => (\r\n \r\n { \r\n setSelectedFilterType(singleFilter.type as FilterTypes);\r\n handleCheckboxChange(singleFilter.type as FilterTypes, childItem.value); \r\n }}\r\n onKeyDown={(e) => { \r\n if (e.keyCode == 13){ \r\n setSelectedFilterType(singleFilter.type as FilterTypes);\r\n handleCheckboxChange(singleFilter.type as FilterTypes, childItem.value);\r\n } \r\n }}\r\n tabIndex={childItem.count === 0 ? -1 : 0}\r\n />\r\n \r\n \r\n ))}\r\n \r\n \r\n
\r\n ))}\r\n >\r\n ) : (\r\n
{ __( 'No filter options available.', 'cg-jobs' ) }
\r\n )\r\n )}\r\n \r\n