import React, { useState } from 'react'; import { Activity, ShieldAlert, Info, X, PieChart, DollarSign, Target } from 'lucide-react'; import { motion, AnimatePresence } from 'framer-motion'; export default function Indicators({ portfolio, isFlattened = false }) { const [activeInfo, setActiveInfo] = useState(null); // 'health' or 'risk' // A simple gauge visualization using SVG const dashArray = 283; // 2 * pi * r (r=45) const dashOffset = dashArray - (dashArray * portfolio.healthScore) / 100; const content = ( <> {/* Portfolio Health Score */}
setActiveInfo('health')} className="bg-white rounded-2xl p-6 shadow-sm border border-gray-100 flex items-center justify-between cursor-pointer hover:border-gs-gold transition-all group h-full" >

Health Score

{portfolio.healthScore} / 100

Click to see how this is calculated

{/* Risk Meter */}
setActiveInfo('risk')} className="bg-white rounded-2xl p-6 shadow-sm border border-gray-100 flex flex-col justify-center cursor-pointer hover:border-gs-gold transition-all group h-full" >

Risk Level

Low Medium High

How we measure risk

{/* Calculation Modal */} {activeInfo && (
setActiveInfo(null)} className="absolute inset-0 bg-gs-navy/40 backdrop-blur-sm" />
{activeInfo === 'health' ? : }

{activeInfo === 'health' ? 'Health Score Logic' : 'Risk Calculation'}

Radical Transparency Report

{activeInfo === 'health' ? ( <>

Fee Efficiency

We subtract points for high expense ratios. Every 0.1% in fees costs your portfolio health (Max -20 pts).

Diversification Bonus

Holding 5+ different asset classes grants a +5 point bonus for reduced concentration risk.

Profile Alignment

If your portfolio's actual volatility doesn't match your goal (e.g. Cautious vs Balanced), we subtract 15 points.

) : (

Market Sensitivity Logic

Risk isn't a guess. We measure how much your portfolio typically swings compared to the broader market to categorize your risk level.

Portfolio Beta {portfolio.avgBeta}
Low Risk Minimal Volatility
Medium Risk Market Standard
High Risk Aggressive Growth
)}
)}
); return isFlattened ? content : (
{content}
); }