'use client' import { formatUptime } from '@/lib/utils' interface Stats { totalSessions: number activeSessions: number totalMessages: number uptime: number errors: number } interface StatsGridProps { stats: Stats systemStats?: any } // SVG stat icons (16x16, stroke-based) function MonitorIcon() { return ( ) } function PulseCircleIcon() { return ( ) } function ChatIcon() { return ( ) } function UptimeIcon() { return ( ) } function WarningTriangleIcon() { return ( ) } function CheckCircleIcon() { return ( ) } interface StatCardProps { title: string value: string | number icon: React.ReactNode trend?: 'up' | 'down' | 'stable' subtitle?: string color?: 'default' | 'success' | 'warning' | 'danger' } function StatCard({ title, value, icon, trend, subtitle, color = 'default' }: StatCardProps) { const colorClasses = { default: 'void-panel', success: 'void-panel border-void-mint/30', warning: 'void-panel border-void-amber/30', danger: 'void-panel border-void-crimson/30' } const iconColorClasses = { default: 'text-void-cyan', success: 'text-void-mint', warning: 'text-void-amber', danger: 'text-void-crimson' } const glowClasses = { default: '', success: 'badge-glow-success', warning: 'badge-glow-warning', danger: 'badge-glow-error' } return (

{title}

{value}

{trend && ( {trend === 'up' ? '\u2197' : trend === 'down' ? '\u2198' : '\u2192'} )}
{subtitle && (

{subtitle}

)}
{icon}
) } export function StatsGrid({ stats, systemStats }: StatsGridProps) { const uptimeFormatted = systemStats?.uptime ? formatUptime(systemStats.uptime) : formatUptime(Date.now() - stats.uptime) return (
} trend="stable" color="default" /> } trend="up" subtitle={`${stats.totalSessions > 0 ? Math.round((stats.activeSessions / stats.totalSessions) * 100) : 0}% active`} color="success" /> } trend="up" subtitle="Total processed" color="default" /> } trend="stable" subtitle="System running" color="default" /> 0 ? : } trend={stats.errors > 0 ? "up" : "stable"} subtitle="Past 24h" color={stats.errors > 0 ? "danger" : "success"} />
) }