import { env } from "@/infrastructure/config/env";

export function getStorageUrl(path: string): string {
  return `${env.backendOrigin}/${path}`;
}

export function formatFileSize(bytes: number): string {
  if (bytes < 1024) return `${bytes} o`;
  if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} Ko`;
  return `${(bytes / (1024 * 1024)).toFixed(1)} Mo`;
}
