(bytes)
| 108 | } |
| 109 | |
| 110 | const formatFileSize = (bytes) => { |
| 111 | if (!bytes) return 'Unknown size' |
| 112 | if (bytes < 1024) return `${bytes} B` |
| 113 | if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB` |
| 114 | return `${(bytes / (1024 * 1024)).toFixed(1)} MB` |
| 115 | } |
| 116 | |
| 117 | const getFileIcon = (file) => { |
| 118 | const ext = file.name?.split('.').pop()?.toLowerCase() |