From f4d8a26972728891de8bde4eeb94c80f027ce2d2 Mon Sep 17 00:00:00 2001 From: diogo464 Date: Mon, 11 Aug 2025 16:04:32 +0100 Subject: basic v0 ui working --- frontend/lib/utils.ts | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) (limited to 'frontend/lib') diff --git a/frontend/lib/utils.ts b/frontend/lib/utils.ts index 857d8d9..bd0c391 100644 --- a/frontend/lib/utils.ts +++ b/frontend/lib/utils.ts @@ -1,27 +1,6 @@ -/** - * Formats a size in bytes into a human-readable string - * @param bytes Size in bytes - * @returns Formatted size string (e.g., "1.5 KB", "2.3 MB", "1.2 GB") - */ -export function formatSize(bytes: number | null): string { - if (bytes === null || bytes === 0) { - return '-' - } +import { clsx, type ClassValue } from "clsx" +import { twMerge } from "tailwind-merge" - const units = ['B', 'KB', 'MB', 'GB', 'TB'] - let size = bytes - let unitIndex = 0 - - while (size >= 1024 && unitIndex < units.length - 1) { - size /= 1024 - unitIndex++ - } - - // Format with appropriate decimal places - if (size < 10 && unitIndex > 0) { - return `${size.toFixed(1)} ${units[unitIndex]}` - } else { - return `${Math.round(size)} ${units[unitIndex]}` - } +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)) } - -- cgit