'use client' import { Card } from '@/components/ui' import { Ticket, Clock, CheckCircle, TrendingUp, AlertCircle, BarChart3 } from 'lucide-react' interface StatsData { total: number open: number in_progress: number resolved: number closed: number thisMonth: number avgDuration: number slaRate: number } interface StatCardProps { title: string value: string | number icon: React.ReactNode color: string } function StatCard({ title, value, icon, color }: StatCardProps) { const displayValue = (value !== undefined && value !== null && !(typeof value === 'number' && isNaN(value))) ? value : '—' return (

{title}

{displayValue}

{icon}
) } export default function StatsOverview({ stats }: { stats: StatsData | null }) { if (!stats) return null return (
} color="bg-blue-600" /> } color="bg-cyan-500" /> } color="bg-amber-500" /> } color={stats.slaRate >= 90 ? 'bg-emerald-500' : stats.slaRate >= 70 ? 'bg-amber-500' : 'bg-red-500'} /> } color="bg-red-500" /> } color="bg-amber-500" /> } color="bg-emerald-500" /> } color="bg-slate-500" />
) }