import { DocumentItem } from '@/types/types'; import { downloadAndShareDocument } from '@/utils/documentUtils'; import { Download, FileText } from 'lucide-react-native'; import React, { useState } from 'react'; import { ActivityIndicator, Text, TouchableOpacity, View } from 'react-native'; interface DocumentListCardProps { item: DocumentItem; } export default function DocumentListCard({ item }: DocumentListCardProps) { const [isDownloading, setIsDownloading] = useState(false); const handleDownload = async () => { setIsDownloading(true); try { await downloadAndShareDocument(item.mimetype, item.filename, item.url); } finally { setIsDownloading(false); } }; return ( {item.filename} {item.date} {isDownloading ? ( ) : ( )} ); }