import { Activity, AlertTriangle, Clock, Database, FileText, Shield, TrendingUp, Users } from 'lucide-react'; import { Card, CardContent } from '@/components/ui/card'; import type { SystemHealthData } from '@/hooks/useSystemHealth'; import type { ModerationHealth } from '@/hooks/admin/useModerationHealth'; interface MonitoringQuickStatsProps { systemHealth?: SystemHealthData; rateLimitStats?: { total_requests: number; blocked_requests: number; unique_ips: number }; moderationHealth?: ModerationHealth; } interface StatCardProps { icon: React.ComponentType<{ className?: string }>; label: string; value: string | number; trend?: 'up' | 'down' | 'neutral'; status?: 'healthy' | 'warning' | 'critical'; } function StatCard({ icon: Icon, label, value, status = 'healthy' }: StatCardProps) { const statusColors = { healthy: 'text-green-500', warning: 'text-yellow-500', critical: 'text-red-500', }; return (

{label}

{value}

); } export function MonitoringQuickStats({ systemHealth, rateLimitStats, moderationHealth }: MonitoringQuickStatsProps) { const criticalAlerts = systemHealth?.critical_alerts_count || 0; const highAlerts = systemHealth?.high_alerts_count || 0; const totalAlerts = criticalAlerts + highAlerts; const blockRate = rateLimitStats?.total_requests ? ((rateLimitStats.blocked_requests / rateLimitStats.total_requests) * 100).toFixed(1) : '0.0'; const queueStatus = (moderationHealth?.queueLength || 0) > 50 ? 'critical' : (moderationHealth?.queueLength || 0) > 20 ? 'warning' : 'healthy'; return (
0 ? 'critical' : highAlerts > 0 ? 'warning' : 'healthy'} /> 5 ? 'warning' : 'healthy'} /> 5 ? 'warning' : 'healthy'} /> 0 ? 'warning' : 'healthy'} /> 0 ? 'warning' : 'healthy'} />
); }