- {[...byCategory.entries()].map(([category, categoryEntries]) => (
-
-
- {category}
-
-
- {categoryEntries.map((entry) => (
-
- ))}
-
-
- ))}
+
+
+ {visibleEntries.length === 0 ? (
+
+ ) : (
+
+ {visibleEntries.map((entry) => (
+
+ ))}
+
+ )}
)}
diff --git a/apps/app/src/components/plugin/management/PluginCategoryFilterPills.tsx b/apps/app/src/components/plugin/management/PluginCategoryFilterPills.tsx
new file mode 100644
index 000000000..48a4df78b
--- /dev/null
+++ b/apps/app/src/components/plugin/management/PluginCategoryFilterPills.tsx
@@ -0,0 +1,45 @@
+import { ToggleGroup, ToggleGroupItem } from "@bb/shared-ui/toggle-group";
+
+const ALL_CATEGORIES = "all";
+
+export function PluginCategoryFilterPills({
+ categories,
+ value,
+ onValueChange,
+}: {
+ categories: readonly string[];
+ value: string | null;
+ onValueChange: (category: string | null) => void;
+}) {
+ if (categories.length === 0) return null;
+
+ return (
+
{
+ if (next.length === 0) return;
+ onValueChange(next === ALL_CATEGORIES ? null : next);
+ }}
+ aria-label="Filter plugins by category"
+ className="flex-wrap justify-start gap-1.5"
+ >
+
+ All
+
+ {categories.map((category) => (
+
+ {category}
+
+ ))}
+
+ );
+}