(bytes: number)
| 127 | } |
| 128 | |
| 129 | const formatFileSize = (bytes: number) => { |
| 130 | if (bytes === 0) return '0 Bytes' |
| 131 | const k = 1024 |
| 132 | const sizes = ['Bytes', 'KB', 'MB', 'GB'] |
| 133 | const i = Math.floor(Math.log(bytes) / Math.log(k)) |
| 134 | return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i] |
| 135 | } |
| 136 | |
| 137 | return ( |
| 138 | <div className={`border-t border-white/10 bg-black/60 backdrop-blur-sm p-4 ${className}`}> |