feat: refactor group detail components for improved member and pending views

This commit is contained in:
Jose Selesan
2026-09-29 16:29:38 -03:00
parent 5ef393fa64
commit 9520763ec3
12 changed files with 432 additions and 196 deletions

View File

@@ -24,7 +24,7 @@ import {
} from '../../../lib/api'
import { useRemoveAttendee } from './useRemoveAttendee'
export type ListSection = 'members' | 'preregistrations' | 'waitlist'
export type ListSection = 'members' | 'pending'
type GroupDetailContextValue = {
groupId: string
@@ -83,12 +83,19 @@ export function GroupDetailProvider({ groupId, children }: { groupId: string; ch
const toast = useToast()
const [isInviteModalOpen, setIsInviteModalOpen] = useState(false)
const [listSection, setListSection] = useState<ListSection>('members')
const [listSection, setListSectionState] = useState<ListSection>('members')
const [attendeeToRemove, setAttendeeToRemove] = useState<AttendeeDto | null>(null)
const [selectedWaitlistEntry, setSelectedWaitlistEntry] = useState<GroupWaitlistEntryDto | null>(null)
const [selectedPreRegistration, setSelectedPreRegistration] = useState<GroupPreRegistrationDto | null>(null)
const [searchFilter, setSearchFilter] = useState('')
// La búsqueda pertenece a la vista que la abrió: al cambiar de pestaña se
// limpia para no heredar un filtro sin coincidencias.
const setListSection = (value: ListSection) => {
setListSectionState(value)
setSearchFilter('')
}
const groupQuery = useQuery({
queryKey: ['group', groupId],
queryFn: () => getGroup(groupId),