import React from 'react'; import { View, Text, StyleSheet, ActivityIndicator } from 'react-native'; interface UploadProgressProps { progress?: number; status: 'idle' | 'uploading' | 'processing' | 'success' | 'error'; error?: string; uploadedCount?: number; totalCount?: number; } export function UploadProgress({ progress, status, error, uploadedCount, totalCount }: UploadProgressProps) { if (status === 'idle') return null; const hasMulti = totalCount !== undefined && totalCount > 1; return ( {status === 'uploading' && ( <> {hasMulti ? `Upload ${uploadedCount || 0}/${totalCount}...` : `Upload en cours...${progress !== undefined ? ` ${progress}%` : ''}`} )} {status === 'processing' && ( <> Traitement OCR en cours... )} {status === 'success' && ( {hasMulti ? `${uploadedCount} fichiers uploadés !` : 'Upload terminé !'} )} {status === 'error' && ( {error || "Erreur lors de l'upload"} )} ); } const styles = StyleSheet.create({ container: { flexDirection: 'row', alignItems: 'center', padding: 12, backgroundColor: '#F5F5F5', borderRadius: 8, marginBottom: 16, }, text: { marginLeft: 8, fontSize: 14, color: '#333', }, success: { color: '#4CAF50', }, error: { color: '#F44336', }, });