import { HardDrive, Folder } from 'lucide-react';
import { useStorageUsage } from '@/hooks/useStorage';
/**
* Props for the StorageUsageCard component.
*/
interface StorageUsageCardProps {
/** Additional CSS classes to apply to the card container */
className?: string;
}
function formatBytes(bytes: number): string {
if (bytes < 1024) return `${bytes} B`;
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
if (bytes < 1024 * 1024 * 1024) return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`;
}
/**
* Displays storage usage statistics in a card format.
* Shows total bytes used, usage percentage with color-coded progress bar,
* file count, max file size, and breakdown by folder. Handles loading
* and error states gracefully.
*
* @description Renders a card showing storage quota usage and file statistics.
* @param props - The component props
* @param props.className - Additional CSS classes for the card container
*
* @example
* // Basic usage
*
Unable to load storage usage