import React, { useState, useEffect, useRef } from 'react'; import { View, ActivityIndicator, TouchableOpacity } from 'react-native'; import { ResizeMode, Video } from 'expo-av'; import { MaterialCommunityIcons } from '@expo/vector-icons'; import * as FileSystem from 'expo-file-system'; import { Colors } from 'src/theme'; import { CACHED_ATTACHMENTS_DIR } from 'src/constants/constants'; import { API_HOST } from 'src/constants'; const RenderMessageVideo = ({ props, token, currentUserId, onLongPress }: { props: any; token: string; currentUserId: number; onLongPress: (currentMessage: any, props: any) => any; }) => { const { currentMessage } = props; if (!currentMessage?.video) return null; const leftMessage = currentMessage?.user?._id !== currentUserId; const videoRef = useRef