export function formatFileSize(sizeInBytes: number): string { if (sizeInBytes < 1024) { return `${sizeInBytes.toFixed(2)} B`; } else if (sizeInBytes < 1024 * 1024) { const sizeInKB = sizeInBytes / 1024; return `${sizeInKB.toFixed(2)} KB`; } else { const sizeInMB = sizeInBytes / 1024 / 1024; return `${sizeInMB.toFixed(2)} MB`; } } export function getFileExtension(filename: string): string { return filename.split('.').pop() || ''; } export function formatFileExtension(ext: string): string { return ext.startsWith('.') ? ext.slice(1).toUpperCase() : ext.toUpperCase(); }