import { CameraRoll } from '@react-native-camera-roll/camera-roll'; import { HeaderBackground, useHeaderHeight } from '@react-navigation/elements'; import { StackNavigationOptions } from '@react-navigation/stack'; import { ResizeMode, Video } from 'expo-av'; import React from 'react'; import { PermissionsAndroid, useWindowDimensions, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; import { shallowEqual } from 'react-redux'; import RNFetchBlob from 'rn-fetch-blob'; import RCActivityIndicator from '../containers/ActivityIndicator'; import * as HeaderButton from '../containers/HeaderButton'; import { ImageViewer } from '../containers/ImageViewer'; import StatusBar from '../containers/StatusBar'; import { LISTENER } from '../containers/Toast'; import { IAttachment } from '../definitions'; import I18n from '../i18n'; import { useAppSelector } from '../lib/hooks'; import { useAppNavigation, useAppRoute } from '../lib/hooks/navigation'; import { formatAttachmentUrl, isAndroid } from '../lib/methods/helpers'; import EventEmitter from '../lib/methods/helpers/events'; import { getUserSelector } from '../selectors/login'; import { TNavigation } from '../stacks/stackType'; import { useTheme } from '../theme'; import { LOCAL_DOCUMENT_DIRECTORY, getFilename } from '../lib/methods/handleMediaDownload'; const RenderContent = ({ setLoading, attachment }: { setLoading: React.Dispatch>; attachment: IAttachment; }) => { const videoRef = React.useRef