"use client"; import { Badge } from "@/components/ui/badge"; import type { GroupWithCount } from "@/types"; interface GroupBadgesProps { selectedGroupId: string | null; onGroupSelect: (groupId: string) => void; refreshTrigger?: number; groups: GroupWithCount[]; isLoading: boolean; } export function GroupBadges({ selectedGroupId, onGroupSelect, groups, isLoading, }: GroupBadgesProps) { if (isLoading && !groups.length) { return (
Loading groups...
); } return (
{groups.map((group) => ( { onGroupSelect(selectedGroupId === group.id ? "default" : group.id); }} > {group.name} {group.count} ))}
); }