text: export const bytesToSize = (bytes) => {
      const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
      if (bytes == 0) return `0 ${sizes[0]}`;
      const i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
      return Math.round((bytes / Math.pow(1024, i)) * 100) / 100 + ' ' + sizes[i];
  }
  
  export const formatNumber = (number, digits) => {
      const digitCount = number === 0 ? 1 : Math.floor(Math.log10(number) + 1)
      let string = ''
    
      digits = Math.max(digitCount, digits)
    
      for (let i = 0; i < digits; i++) {
        const currentDigit = Math.floor(number / 10 ** (digits - i - 1)) % 10
        string += currentDigit.toString()
      }
    
      return string
  }
  
  const SECOND = 1000
  const MINUTE = 60 * SECOND
  const HOUR = 60 * MINUTE
  
  export const formatTime = (time) => {
    const hours = Math.floor(time / HOUR)
    const minutes = Math.floor(time / MINUTE) % 60
    const seconds = Math.floor(time / SECOND) % 60
    const milliseconds = time % 1000
    return { hours, minutes, seconds, milliseconds }
  }