'use client'; import { TrendingUp, TrendingDown, Activity } from 'lucide-react'; interface RiskDistributionCardProps { lowRisk: number; mediumRisk: number; highRisk: number; criticalRisk: number; } export default function RiskDistributionCard({ lowRisk, mediumRisk, highRisk, criticalRisk }: RiskDistributionCardProps) { const total = lowRisk + mediumRisk + highRisk + criticalRisk; const data = [ { label: 'Low Risk', value: lowRisk, color: 'bg-emerald-400', percentage: (lowRisk / total * 100).toFixed(1) }, { label: 'Medium Risk', value: mediumRisk, color: 'bg-yellow-400', percentage: (mediumRisk / total * 100).toFixed(1) }, { label: 'High Risk', value: highRisk, color: 'bg-orange-400', percentage: (highRisk / total * 100).toFixed(1) }, { label: 'Critical', value: criticalRisk, color: 'bg-red-400', percentage: (criticalRisk / total * 100).toFixed(1) }, ]; // Create a simple scatter-like visualization const generatePoints = () => { const points: { x: number; y: number; risk: string; color: string }[] = []; // Generate clustered points for each risk level data.forEach((item, riskIndex) => { const count = Math.min(item.value, 30); // Cap at 30 points per category for (let i = 0; i < count; i++) { const baseX = 20 + (riskIndex * 20) + Math.random() * 15; const baseY = 20 + Math.random() * 60; points.push({ x: Math.min(95, Math.max(5, baseX)), y: Math.min(95, Math.max(5, baseY)), risk: item.label, color: item.color.replace('bg-', '') }); } }); return points; }; const points = generatePoints(); return (
Transaction Risk Mapping
{item.label}