feat: fix responsive layout, add theme switcher

This commit is contained in:
2024-08-17 00:21:23 +07:00
parent 43af9c8658
commit f503b261f5
22 changed files with 349 additions and 100 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ export const ucfirst = (text?: string | null) => {
export const readableBytes = (bytes?: number | null, divider = 1024) => {
if (bytes == null || Number.isNaN(bytes)) return "n/a";
const sizes = ["Bytes", "KB", "MB", "GB", "TB"];
const sizes = ["B", "KB", "MB", "GB", "TB"];
const i = Math.max(0, Math.floor(Math.log(bytes) / Math.log(divider)));
return `${(bytes / Math.pow(divider, i)).toFixed(1)} ${sizes[i]}`;