import React from 'react'; import { motion } from 'framer-motion'; import { Brain, TrendingUp, AlertTriangle, CheckCircle } from 'lucide-react'; const PredictionCard = ({ predictions, confidence, vertical }) => { // Helper to format values based on key const formatValue = (key, value) => { if (key.includes('amount') || key.includes('impact_usd')) return `$${(value / 1000000).toFixed(1)}M`; if (key.includes('days')) return `${value} days`; if (key.includes('pct') || key.includes('probability')) return `${value}%`; return value; }; // Helper to get confidence color const getConfidenceColor = (score) => { if (score >= 0.9) return 'text-emerald-500'; if (score >= 0.7) return 'text-blue-500'; return 'text-amber-500'; }; return (

Live ML Predictions

Inference Engine v2.1

LIVE
{predictions && Object.entries(predictions).map(([key, value], idx) => { const conf = confidence ? (confidence[key] || 0.85) : 0.85; const confPct = (conf * 100).toFixed(1); return (
{key.replace(/_/g, ' ')}
{confPct}% Conf.
{formatValue(key, value)} (±{(100 - conf * 100).toFixed(1)}% range)
{/* Confidence Bar */}
= 0.9 ? 'bg-emerald-500' : conf >= 0.7 ? 'bg-blue-500' : 'bg-amber-500'}`} />
); })}
MODEL: XGBoost-Pro-v4 LATENCY: 42ms
); }; export default PredictionCard;