/** * Proxy Stats Card Component */ import type { ProxyStats } from '../types'; import { Card, CardHeader, CardContent } from '@/components/ui/Card'; import { StatusBadge } from './StatusBadge'; import { formatPercentage } from '../utils/formatters'; interface ProxyStatsCardProps { stats: ProxyStats; } export function ProxyStatsCard({ stats }: ProxyStatsCardProps) { const successRate = stats.totalProxies > 0 ? (stats.workingProxies / stats.totalProxies) * 100 : 0; const formatDate = (dateString?: string) => { if (!dateString) {return 'Never';} const date = new Date(dateString); return date.toLocaleString(); }; return (

Proxy Status

{stats.enabled ? 'Enabled' : 'Disabled'}
{stats.enabled ? (

Total Proxies

{stats.totalProxies}

Success Rate

{formatPercentage(successRate)}

Working

{stats.workingProxies}

Failed

{stats.failedProxies}

Last Update: {formatDate(stats.lastUpdate)}
Last Fetch: {formatDate(stats.lastFetchTime)}
{stats.totalProxies === 0 && (
No proxies available. Check WebShare API configuration.
)}
) : (

Proxy service is disabled

Enable it in the configuration to use proxies

)}
); }