(bytes)
| 69 | } |
| 70 | |
| 71 | const formatFileSize = (bytes) => { |
| 72 | if (!bytes) return 'Unknown size' |
| 73 | if (bytes < 1024) return `${bytes} B` |
| 74 | if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB` |
| 75 | return `${(bytes / (1024 * 1024)).toFixed(1)} MB` |
| 76 | } |
| 77 | |
| 78 | const getFileTypeName = (file) => { |
| 79 | const ext = file.name?.split('.').pop()?.toLowerCase() |