+ {selectedCategoryDetails.length > 0 && (
+
+
+ {selectedCategoryDetails.map((category) => {
+ if (!category) return null;
+ const IconComponent = category.icon
+ ? getIconComponent(category.icon)
+ : null;
+ const colorIndex = selectedCategories.indexOf(category.id);
+ const color = CHART_COLORS[colorIndex % CHART_COLORS.length];
+
+ return (
+
+ {IconComponent ? (
+
+ ) : (
+
+ )}
+
{category.name}
+
+
+ );
+ })}
+
+
+
+ {selectedCategories.length}/5 selecionadas
+
+
+
+
+ )}
+
+ {selectedCategories.length < 5 && availableCategories.length > 0 && (
+
+
+
+
+
+
+
+
+ Nenhuma categoria encontrada.
+
+ {despesaCategories.length > 0 && (
+
+ {despesaCategories.map((category) => {
+ const IconComponent = category.icon
+ ? getIconComponent(category.icon)
+ : null;
+ return (
+ handleAddCategory(category.id)}
+ className="gap-2"
+ >
+ {IconComponent ? (
+
+ ) : (
+
+ )}
+ {category.name}
+
+ );
+ })}
+
+ )}
+
+ {receitaCategories.length > 0 && (
+
+ {receitaCategories.map((category) => {
+ const IconComponent = category.icon
+ ? getIconComponent(category.icon)
+ : null;
+ return (
+ handleAddCategory(category.id)}
+ className="gap-2"
+ >
+ {IconComponent ? (
+
+ ) : (
+
+ )}
+ {category.name}
+
+ );
+ })}
+
+ )}
+
+
+
+
+ )}
+
+
+ {isEmpty ? (
+