import React from 'react'; import { View, Text, StyleSheet, ActivityIndicator } from 'react-native'; interface UploadProgressProps { progress?: number; status: 'idle' | 'uploading' | 'processing' | 'success' | 'error'; error?: string; } export function UploadProgress({ progress, status, error }: UploadProgressProps) { if (status === 'idle') return null; return ( {status === 'uploading' && ( <> Upload en cours... {progress !== undefined && `${progress}%`} )} {status === 'processing' && ( <> Traitement OCR en cours... )} {status === 'success' && ( 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', }, });