feat: refactor group detail components for improved member and pending views
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user