+ {expand ? (
+ <>
+ {categories
+ .sort((a, b) => -b.name.localeCompare(a.name))
+ .map(category => (
+
+ ))}
+
+
+ >
+ ) : (
+ <>
+ {categories
+ .sort((a, b) => -b.name.localeCompare(a.name))
+ .slice(0, MAX_CATEGORIES_DISPLAYED)
+ .map(category => (
+
+ ))}
+ {categories.length > MAX_CATEGORIES_DISPLAYED ? (
+
setExpand(true)}>
+ and {categories.length - MAX_CATEGORIES_DISPLAYED} more...
+
+ ) : (
+
+ )}
+ >
+ )}
+