import { Inbox, Users } from 'lucide-react' import { cn } from '../../../lib/utils' import { type ListSection, useGroupDetail } from './GroupDetailProvider' const SECTIONS = [ { id: 'members', label: 'Miembros', icon: Users }, { id: 'pending', label: 'Pendientes', icon: Inbox }, ] as const satisfies ReadonlyArray<{ id: ListSection label: string icon: typeof Users }> export function SectionChips() { const { listSection, setListSection, attendeesTotal, preRegistrationsTotal, waitlistTotal, } = useGroupDetail() const counts: Record = { members: attendeesTotal, pending: preRegistrationsTotal + waitlistTotal, } return (
{SECTIONS.map((section) => { const isActive = listSection === section.id const count = counts[section.id] // Amber only when there is something to decide: pre-registrations to // review. const isAttention = section.id === 'pending' && preRegistrationsTotal > 0 const Icon = section.icon return ( ) })}
) }