From 5ef393fa648cce3e9367abd55c1c935f8469062d Mon Sep 17 00:00:00 2001 From: Jose Selesan Date: Tue, 29 Sep 2026 15:41:13 -0300 Subject: [PATCH] feat: add SectionChips component for improved navigation between members, pre-registrations, and waitlist --- .../groups/detail/MembersWaitlistSection.tsx | 71 ++---------------- .../features/groups/detail/SectionChips.tsx | 73 +++++++++++++++++++ 2 files changed, 80 insertions(+), 64 deletions(-) create mode 100644 apps/web/src/features/groups/detail/SectionChips.tsx diff --git a/apps/web/src/features/groups/detail/MembersWaitlistSection.tsx b/apps/web/src/features/groups/detail/MembersWaitlistSection.tsx index ac09031..c25b16c 100644 --- a/apps/web/src/features/groups/detail/MembersWaitlistSection.tsx +++ b/apps/web/src/features/groups/detail/MembersWaitlistSection.tsx @@ -1,20 +1,17 @@ import { useNavigate } from '@tanstack/react-router' import { Clock, Loader2, Plus, Search, Share2, UserCheck, Users } from 'lucide-react' import { Button, Input } from '../../../components/ui' -import { cn } from '../../../lib/utils' import { useGroupDetail } from './GroupDetailProvider' import { MembersTable } from './MembersTable' import { PreRegistrationsTable } from './PreRegistrationsTable' +import { SectionChips } from './SectionChips' import { WaitlistTable } from './WaitlistTable' -const TAB_CLASS = - 'flex min-h-10 flex-1 items-center justify-center gap-1.5 rounded-md px-2 text-xs font-semibold transition-[color,background-color,box-shadow] duration-150' - export function MembersWaitlistSection() { const { - groupId, attendees, attendeesTotal, attendeesPending, - waitlistEntries, waitlistTotal, waitlistPending, - preRegistrations, preRegistrationsTotal, preRegistrationsPending, + groupId, attendees, attendeesPending, + waitlistEntries, waitlistPending, + preRegistrations, preRegistrationsPending, listSection, setListSection, searchFilter, setSearchFilter, openInviteModal, } = useGroupDetail() const navigate = useNavigate() @@ -41,65 +38,11 @@ export function MembersWaitlistSection() { // Sin bordes: el lavado `bg-primary-soft` separa la sección del fondo.
-
-
- - - -
+
+ {showSearch ? ( -
+
+ +export function SectionChips() { + const { listSection, setListSection, attendeesTotal, preRegistrationsTotal, waitlistTotal } = + useGroupDetail() + + const counts: Record = { + members: attendeesTotal, + preregistrations: preRegistrationsTotal, + waitlist: waitlistTotal, + } + + return ( +
+ {SECTIONS.map((section) => { + const isActive = listSection === section.id + const count = counts[section.id] + const Icon = section.icon + + return ( + + ) + })} +
+ ) +}