import React, { useCallback, useContext } from 'react'; import { FlatList, ListRenderItem } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import type { UserStruct } from '@gathertown/uikit-utils'; import { getUserUniqId } from '@gathertown/uikit-utils'; import { UserListContexts } from '../module/moduleContext'; import type { UserListContextsType, UserListProps } from '../types'; const UserListList = ({ users, onRefresh, refreshing, renderUser, onLoadNext, ListEmptyComponent, }: UserListProps['List']) => { const context = useContext(UserListContexts.List as UserListContextsType['List']); const renderItem: ListRenderItem = useCallback( ({ item }) => renderUser?.(item, context.selectedUsers, context.setSelectedUsers), [renderUser, context.selectedUsers, context.setSelectedUsers], ); const { left, right } = useSafeAreaInsets(); return ( ); }; export default UserListList;