import React, { useState, useEffect } from 'react'; import { motion } from 'framer-motion'; import { TrendingUp, Activity, DollarSign, Target } from 'lucide-react'; const ModelPerformance = () => { const [metrics, setMetrics] = useState(null); useEffect(() => { const fetchPnL = async () => { try { const res = await fetch(`${import.meta.env.VITE_API_URL}/api/pnl`); const data = await res.json(); setMetrics(data); } catch (e) { console.error("PnL fetch error", e); } }; fetchPnL(); const interval = setInterval(fetchPnL, 5000); // Live updates return () => clearInterval(interval); }, []); if (!metrics) return
; return (Live P&L Simulation