import {useState} from 'react' import {Button, Dimensions, Pressable, Text, View} from 'react-native' import DocumentPicker, { DocumentPickerResponse, types, } from 'react-native-document-picker' import {backgroundColor} from './constants' import Item from './Item' const buttonWidth = '45%' export default function App() { const [files, setFiles] = useState([]) const [selected, setSelected] = useState(0) const [paused, setPaused] = useState(false) const pick = async () => { const picked = await DocumentPicker.pickMultiple({ type: [types.video, types.images], }) setSelected(0) console.log(`Picked ${picked.length} files.`) setFiles(picked) } const prev = () => { if (selected <= 0) return setSelected(selected - 1) setPaused(false) } const next = () => { if (selected >= files.length - 1) return setSelected(selected + 1) setPaused(false) } return ( {files.length > 0 ? ( <>