'use client'; import { Clock } from 'lucide-react'; interface ProcessingStatsCardProps { avgLatency: number; peakHour: number; throughput: number; uptime: number; } export default function ProcessingStatsCard({ avgLatency, peakHour, throughput, uptime }: ProcessingStatsCardProps) { // Generate radial chart data for 24-hour processing const hours = Array.from({ length: 24 }, (_, i) => { const baseLoad = 40 + Math.random() * 30; const peakBoost = Math.abs(i - peakHour) < 3 ? 20 : 0; return Math.min(100, baseLoad + peakBoost); }); return (
{/* Header */}

PROCESSING

Real-time Statistics

Online
{/* Radial Chart */}
{/* Background circle */} {/* Hour marks and bars */} {hours.map((load, hour) => { const angle = (hour * 15) - 90; const radians = (angle * Math.PI) / 180; const innerRadius = 20; const outerRadius = 20 + (load / 100) * 25; const x1 = 50 + innerRadius * Math.cos(radians); const y1 = 50 + innerRadius * Math.sin(radians); const x2 = 50 + outerRadius * Math.cos(radians); const y2 = 50 + outerRadius * Math.sin(radians); const isPeak = hour === peakHour; return ( ); })} {/* Center */} {avgLatency} ms avg {/* Hour labels */}
00
12
18
06
{/* Stats Grid */}

{throughput}

TPS

{peakHour}:00

Peak

{uptime}%

Uptime

); }