import { ListRenderItemInfo, View } from 'react-native'; import { useColors } from '../../hook'; import { usePaletteContext } from '../../theme'; import { Alert } from '../../ui/Alert'; import { FlatListFactory } from '../../ui/FlatList'; import { BottomSheetNameMenu } from '../BottomSheetMenu'; import { EmptyPlaceholder, ErrorPlaceholder } from '../Placeholder'; import { useGroupParticipantList } from './GroupParticipantList.hooks'; import { GroupParticipantListNavigationBar } from './GroupParticipantList.navi'; import type { GroupParticipantListItemProps, GroupParticipantListProps, } from './types'; const FlatList = FlatListFactory(); /** * Group Participant List Component. */ export function GroupParticipantList(props: GroupParticipantListProps) { const { containerStyle, onBack, participantType, navigationBarVisible, customNavigationBar, } = props; const { data, refreshing, onRefresh, ref, onMore, viewabilityConfig, onViewableItemsChanged, listState, onClicked, onLongPressed, participantCount, onClickedAddParticipant, onClickedDelParticipant, selectedCount, onDelParticipant, onSelectParticipant, alertRef, onCheckClicked, menuRef, onRequestCloseMenu, ListItemRender, groupId, ownerId, onReload, } = useGroupParticipantList(props); const { colors } = usePaletteContext(); const { getColor } = useColors({ text_disable: { light: colors.neutral[7], dark: colors.neutral[3], }, text_enable: { light: colors.error[5], dark: colors.error[6], }, }); return ( {navigationBarVisible !== false ? ( ) : null} ) => { const { item } = info; return ( ); }} keyExtractor={(item: GroupParticipantListItemProps) => { return item.id; }} onEndReached={onMore} viewabilityConfig={viewabilityConfig} onViewableItemsChanged={onViewableItemsChanged} ListEmptyComponent={EmptyPlaceholder} ListErrorComponent={ listState === 'error' ? ( { onReload?.(); }} /> ) : null } /> ); }