update user files info

This commit is contained in:
smanylov
2026-01-07 13:03:50 +07:00
parent 5597fe42a2
commit aa0f9398eb
16 changed files with 371 additions and 76 deletions
+15
View File
@@ -0,0 +1,15 @@
export function convertBytes(bytes: number) {
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
if (bytes === 0) return '0 B';
let i = 0;
let value = bytes;
while (value >= 1024 && i < units.length - 1) {
value /= 1024;
i++;
}
return `${value.toFixed(1)} ${units[i]}`;
}