show directory sizes
This commit is contained in:
@@ -255,7 +255,7 @@
|
||||
class="shrink-0 px-4 h-full flex items-center justify-end text-xs text-text-secondary mono text-right tabular-nums font-medium border-r border-border-color/10"
|
||||
style="width: {colWidths.size}px"
|
||||
>
|
||||
{item.type === "directory" ? "" : formatSize(item.size)}
|
||||
{formatSize(item.size)}
|
||||
</div>
|
||||
|
||||
<!-- QUICK ACTIONS -->
|
||||
|
||||
@@ -43,8 +43,9 @@ export function formatLocalDateTime(dateStr: string | null | undefined): string
|
||||
* Formats a byte count into a human-readable string (KB, MB, GB, TB).
|
||||
* (MEDIUM #28 — consolidated from 5+ duplicate implementations)
|
||||
*/
|
||||
export function formatSize(bytes: number): string {
|
||||
export function formatSize(bytes: number | null | undefined): string {
|
||||
if (bytes === 0) return "0 B";
|
||||
if (!bytes) return "—";
|
||||
const units = ["B", "KB", "MB", "GB", "TB"];
|
||||
let unitIndex = 0;
|
||||
let size = bytes;
|
||||
|
||||
Reference in New Issue
Block a user