diff --git a/src/App.jsx b/src/App.jsx index 4f77143e..19090c71 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -176,29 +176,24 @@ const kpis = [ }, ]; -const latestValue = data.length > 4 ? data[4].value : null; -const prevValue = data.length > 3 ? data[3].value : null; -const latestDate = data.length > 4 ? data[4].date : null; +const latestValue = data.length > 4 ? data[4].value : null; +const prevValue = data.length > 3 ? data[3].value : null; +const latestDate = data.length > 4 ? data[4].date : null; -let trend = null; -let trendColor = null; +let trendValue = null; if (latestValue && prevValue) { - const diff = ((latestValue - prevValue) / prevValue) * 100; - - trend = `${diff >= 0 ? "+" : ""}${diff.toFixed(2)}%`; - trendColor = diff >= 0 ? "#16A34A" : "#DC2626"; // vert / rouge + trendValue = ((latestValue - prevValue) / prevValue) * 100; } + const news = [ { type: "Forex", label: `EUR/USD: ${latestValue?.toFixed(4)}`, - trend, - color: "#1E3A8A", date: latestDate, icon: TrendingUp, - trendColor, + trendValue, // <- même logique que KPIs }, // { // type: "Logistic", @@ -550,12 +545,19 @@ export default function App() {