(bytes)
| 15 | } |
| 16 | |
| 17 | const formatFileSize = (bytes) => { |
| 18 | if (!bytes) return 'Unknown size' |
| 19 | if (bytes < 1024) return `${bytes} B` |
| 20 | if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB` |
| 21 | return `${(bytes / (1024 * 1024)).toFixed(1)} MB` |
| 22 | } |
| 23 | |
| 24 | const getFileIcon = (file) => { |
| 25 | const ext = file.name?.split('.').pop()?.toLowerCase() |