import React from 'react'; import { Text } from 'react-native'; import Touchable from 'react-native-platform-touchable'; import { IUser } from '../../../../definitions'; import { VideoConferenceType } from '../../../../definitions/IVideoConference'; import i18n from '../../../../i18n'; import { useAppSelector } from '../../../../lib/hooks'; import { useVideoConf } from '../../../../lib/hooks/useVideoConf'; import { CallParticipants, TCallUsers } from './CallParticipants'; import useStyle from './styles'; import { VideoConferenceBaseContainer } from './VideoConferenceBaseContainer'; export default function VideoConferenceEnded({ users, type, createdBy, rid }: { users: TCallUsers; type: VideoConferenceType; createdBy: Pick; rid: string; }): React.ReactElement { const style = useStyle(); const username = useAppSelector(state => state.login.user.username); const { showInitCallActionSheet } = useVideoConf(rid); const onlyAuthorOnCall = users.length === 1 && users.some(user => user.username === createdBy.username); return ( {type === 'direct' ? ( <> {createdBy.username === username ? i18n.t('Call_back') : i18n.t('Call_again')} {i18n.t('Call_was_not_answered')} ) : ( <> {users.length && !onlyAuthorOnCall ? ( ) : ( {i18n.t('Call_was_not_answered')} )} )} ); }