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 { useSnaps } from '../../../../lib/hooks/useSnaps'; import { useActionSheet } from '../../../ActionSheet'; import CallAgainActionSheet from './CallAgainActionSheet'; 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 { showActionSheet } = useActionSheet(); const snaps = useSnaps([1250]); const onlyAuthorOnCall = users.length === 1 && users.some(user => user.username === createdBy.username); return ( {type === 'direct' ? ( <> showActionSheet({ children: , snaps }) } > {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')} )} )} ); }