export const DOWNLOAD_THRESHOLDS = {
  FAST: 200,
  MODERATE: 600,
} as const;

export type DownloadPerformance = {
  color: string;
  label: string;
  description: string;
};

export const getDownloadPerformance = (downloadMs: number): DownloadPerformance => {
  if (downloadMs < DOWNLOAD_THRESHOLDS.FAST) {
    return {
      color: 'text-green-400',
      label: 'Excellent',
      description: 'CDN cache hit with optimal image size',
    };
  }

  if (downloadMs < DOWNLOAD_THRESHOLDS.MODERATE) {
    return {
      color: 'text-yellow-400',
      label: 'Good',
      description: 'Cache hit but large file, or slower CDN response',
    };
  }

  return {
    color: 'text-red-400',
    label: 'Poor',
    description: 'CDN miss, large file size, or optimization needed',
  };
};
