import { type ReactNode } from 'react'; interface EnhancedMetricCardProps { title: string; value: string | number; subtitle?: string; status?: 'good' | 'average' | 'warning'; statusText?: string; icon: ReactNode; chart?: ReactNode; details?: ReactNode; onClick?: () => void; className?: string; animationDelay?: number; horizontal?: boolean; } export function EnhancedMetricCard({ title, value, subtitle, status, statusText, icon, chart, details, onClick, className = '', animationDelay = 0, horizontal = false, }: EnhancedMetricCardProps) { const statusColors: Record = { good: '#5ee6a0', average: '#f2c94c', warning: '#f2c94c', }; // Horizontal layout for cards like Active User if (horizontal) { return (
{icon}
{title}
{value}
{subtitle && (
{subtitle}
)} {details &&
{details}
}
Details
{chart && (
{chart}
)}
); } // Standard vertical card layout - matching self.html exactly return (
{icon}
{title}
{value}
{(subtitle || statusText) && (
{statusText && status && ( {statusText} )}{' '} {subtitle}
)} {chart &&
{chart}
} {details &&
{details}
}
Details
); } interface CacheMetricCardProps { totalMB: number; cacheMB: number; nonCacheMB: number; onClick?: () => void; animationDelay?: number; } export function CacheMetricCard({ totalMB, cacheMB, nonCacheMB, onClick, animationDelay = 0, }: CacheMetricCardProps) { const cachePercent = Math.round((cacheMB / totalMB) * 100); const nonCachePercent = Math.round((nonCacheMB / totalMB) * 100); return (
Cache
{totalMB} MB
{Math.round(totalMB * 0.625)}MB Average cached images and files
{/* Segmented Bar */}
{/* Stats Row */}
Cache
{cacheMB} MB {cachePercent}%
Non-Cache
{nonCacheMB} MB {nonCachePercent}%
Total
{totalMB * 5} GB
Details
); } interface PerformanceMetricCardProps { percentage: number; upSpeed: number; downSpeed: number; datasets: Array<{ data: number[]; color: string; fillOpacity?: number }>; onClick?: () => void; animationDelay?: number; } export function PerformanceMetricCard({ percentage, upSpeed, downSpeed, onClick, animationDelay = 0, }: PerformanceMetricCardProps) { const status = percentage >= 85 ? 'Good' : percentage >= 70 ? 'Average' : 'Warning'; const statusColor = percentage >= 85 ? '#5ee6a0' : percentage >= 70 ? '#f2c94c' : '#ff6f5c'; return (
Performance
{percentage}%
{status} Last scan on {new Date().toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' })}
{/* Chart placeholder - will be replaced with actual chart */}
{upSpeed} Mbps
{downSpeed} Mbps
Check Speed
); }