Implement admin dash workspaces tab

This commit is contained in:
2024-11-10 15:03:51 +01:00
parent 148001be43
commit 5e2d434b4b
11 changed files with 258 additions and 189 deletions

View File

@@ -0,0 +1,10 @@
export const formatBytes = (bytes) => {
const units = ['B', 'KB', 'MB', 'GB'];
let size = bytes;
let unitIndex = 0;
while (size >= 1024 && unitIndex < units.length - 1) {
size /= 1024;
unitIndex++;
}
return `${size.toFixed(1)} ${units[unitIndex]}`;
};