export const formatBytes = (bytes = 0) => {
  if (!bytes || bytes === 0) return "0 B";
  const sizes = ["B", "KB", "MB", "GB", "TB"];
  const i = Math.floor(Math.log(bytes) / Math.log(1024));
  const value = bytes / Math.pow(1024, i);
  const digits = i <= 1 ? 0 : 1;
  return `${value.toFixed(digits)} ${sizes[i]}`;
};
