import * as DocumentPicker from 'expo-document-picker'; import React from 'react'; import { Alert, FlatList, Image, Platform, Text, View } from 'react-native'; import Button from '../components/Button'; import TitleSwitch from '../components/TitledSwitch'; export default function DocumentPickerScreen() { const [copyToCache, setCopyToCache] = React.useState(false); const [multiple, setMultiple] = React.useState(false); const [pickerResult, setPickerResult] = React.useState(null); const openPicker = async () => { const time = Date.now(); const result = await DocumentPicker.getDocumentAsync({ copyToCacheDirectory: copyToCache, multiple, }); console.log(`Duration: ${Date.now() - time}ms`); console.log(`Results:`, result); if (!result.canceled) { setPickerResult(result); } else { setTimeout(() => { if (Platform.OS === 'web') { alert('Cancelled'); } else { Alert.alert('Cancelled'); } }, 100); } }; return (