show disk space reclaimed by media sync (#24189)

This commit is contained in:
Josh Hawkins
2026-09-12 07:30:04 -06:00
committed by Nicolas Mowen
parent d6b93301e2
commit 6d33b31bc6
6 changed files with 112 additions and 8 deletions
+8
View File
@@ -5,3 +5,11 @@ export const getUnitSize = (MB: number) => {
return `${(MB / 1048576).toFixed(2)} TiB`;
};
export const getUnitSizeFromBytes = (bytes: number) => {
if (bytes === null || isNaN(bytes) || bytes < 0) return "Invalid number";
if (bytes < 1024) return `${bytes} B`;
if (bytes < 1048576) return `${(bytes / 1024).toFixed(2)} KiB`;
return getUnitSize(bytes / 1048576);
};