refactor: remove unused attendee detail components and provider
This commit is contained in:
@@ -3,6 +3,7 @@ import type { ReactNode } from 'react'
|
||||
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
||||
import type {
|
||||
AttendeeDto,
|
||||
AttendeeListItem,
|
||||
GroupDto,
|
||||
GroupPreRegistrationDto,
|
||||
GroupWaitlistEntryDto,
|
||||
@@ -33,7 +34,7 @@ type GroupDetailContextValue = {
|
||||
groupTitle: string
|
||||
groupQueryPending: boolean
|
||||
riskLevel: GroupRiskLevel
|
||||
attendees: AttendeeDto[]
|
||||
attendees: AttendeeListItem[]
|
||||
attendeesTotal: number
|
||||
attendeesPending: boolean
|
||||
waitlistEntries: GroupWaitlistEntryDto[]
|
||||
@@ -49,6 +50,9 @@ type GroupDetailContextValue = {
|
||||
whatsappMessage: string
|
||||
searchFilter: string
|
||||
setSearchFilter: (value: string) => void
|
||||
/** La lista de miembros se reduce a quienes tienen el cobro vencido. */
|
||||
overdueOnly: boolean
|
||||
setOverdueOnly: (value: boolean) => void
|
||||
listSection: ListSection
|
||||
setListSection: (value: ListSection) => void
|
||||
isInviteModalOpen: boolean
|
||||
@@ -90,12 +94,14 @@ export function GroupDetailProvider({ groupId, children }: { groupId: string; ch
|
||||
const [selectedWaitlistEntry, setSelectedWaitlistEntry] = useState<GroupWaitlistEntryDto | null>(null)
|
||||
const [selectedPreRegistration, setSelectedPreRegistration] = useState<GroupPreRegistrationDto | null>(null)
|
||||
const [searchFilter, setSearchFilter] = useState('')
|
||||
const [overdueOnly, setOverdueOnly] = useState(false)
|
||||
|
||||
// La búsqueda pertenece a la vista que la abrió: al cambiar de pestaña se
|
||||
// limpia para no heredar un filtro sin coincidencias.
|
||||
// Los controles de la lista pertenecen a la vista que los abrió: al cambiar de
|
||||
// pestaña se limpian para no heredar un filtro sin coincidencias.
|
||||
const setListSection = (value: ListSection) => {
|
||||
setListSectionState(value)
|
||||
setSearchFilter('')
|
||||
setOverdueOnly(false)
|
||||
}
|
||||
|
||||
const groupQuery = useQuery({
|
||||
@@ -313,6 +319,8 @@ export function GroupDetailProvider({ groupId, children }: { groupId: string; ch
|
||||
whatsappMessage,
|
||||
searchFilter,
|
||||
setSearchFilter,
|
||||
overdueOnly,
|
||||
setOverdueOnly,
|
||||
listSection,
|
||||
setListSection,
|
||||
isInviteModalOpen,
|
||||
|
||||
Reference in New Issue
Block a user