(bytes?: number)
| 189 | |
| 190 | // Format file size |
| 191 | const formatFileSize = (bytes?: number) => { |
| 192 | if (!bytes) return ''; |
| 193 | const sizes = ['B', 'KB', 'MB', 'GB']; |
| 194 | const i = Math.floor(Math.log(bytes) / Math.log(1024)); |
| 195 | const size = (bytes / Math.pow(1024, i)).toFixed(1) |
| 196 | return size !== '0' ? `${size} ${sizes[i]}` : ''; |
| 197 | }; |
| 198 | |
| 199 | // Handle drag start |
| 200 | const handleDragStart = (e: React.DragEvent, node: FolderNode) => { |