// @flow import React, { useCallback } from 'react'; import { useTranslation } from 'react-i18next'; import { Text, View } from 'react-native'; import { Button } from 'react-native-paper'; import { useDispatch, useSelector } from 'react-redux'; import { Icon, IconInviteMore } from '../../../base/icons'; import { getLocalParticipant, getParticipantCountWithFake, getSortedParticipants } from '../../../base/participants'; import { connect } from '../../../base/redux'; import { doInvitePeople } from '../../../invite/actions.native'; import { showConnectionStatus, showContextMenuDetails, showSharedVideoMenu } from '../../actions.native'; import { shouldRenderInviteButton } from '../../functions'; import MeetingParticipantItem from './MeetingParticipantItem'; import styles from './styles'; type Props = { /** * Shared video local participant owner. */ _localVideoOwner: boolean } const MeetingParticipantList = ({ _localVideoOwner }: Props) => { const dispatch = useDispatch(); const onInvite = useCallback(() => dispatch(doInvitePeople()), [ dispatch ]); const participantsCount = useSelector(getParticipantCountWithFake); const sortedParticipants = useSelector(getSortedParticipants); const showInviteButton = useSelector(shouldRenderInviteButton); const { t } = useTranslation(); // eslint-disable-next-line react/no-multi-comp const renderParticipant = p => { if (p.isFakeParticipant) { if (_localVideoOwner) { return ( dispatch(showSharedVideoMenu(p)) } participantID = { p.id } /> ); } return ( ); } return ( p.local ? dispatch(showConnectionStatus(p.id)) : dispatch(showContextMenuDetails(p)) } participantID = { p.id } /> ); }; return ( {t('participantsPane.headings.participantsList', { count: participantsCount })} { showInviteButton &&