diff --git a/components/CalendarTab.tsx b/components/CalendarTab.tsx index 013da5b..5dbcbac 100644 --- a/components/CalendarTab.tsx +++ b/components/CalendarTab.tsx @@ -23,6 +23,16 @@ const CATEGORY_LABELS: Record = { trade_balance: "Balance comm.", }; +// ── Currency → ISO alpha-2 (pour flagcdn.com) ───────────────────────────────── + +const CCY_ISO: Record = { + USD: "us", EUR: "eu", GBP: "gb", JPY: "jp", + CAD: "ca", AUD: "au", NZD: "nz", CHF: "ch", + CNY: "cn", SEK: "se", NOK: "no", DKK: "dk", + SGD: "sg", HKD: "hk", MXN: "mx", BRL: "br", + ZAR: "za", INR: "in", KRW: "kr", TRY: "tr", +}; + // ── Helpers ─────────────────────────────────────────────────────────────────── function isoToLocalDate(iso: string): string { @@ -105,8 +115,18 @@ function EventRow({ ev, isChild, expanded, onToggle }: { - {meta?.flag} - {ev.currency} +
+
+ {ev.currency} { (e.target as HTMLImageElement).style.display = "none"; }} + /> +
+ {ev.currency} +
diff --git a/components/NewsTab.tsx b/components/NewsTab.tsx index 0a2f500..e234ce6 100644 --- a/components/NewsTab.tsx +++ b/components/NewsTab.tsx @@ -348,8 +348,17 @@ function NewsCard({ item, secondary = false }: { item: NewsItem; secondary?: boo )} - {/* Titre + heure + Analyse sur la même ligne */} + {/* Heure + Analyse + Titre */}
+
+ {formatRelativeTime(item.publishedAt)} + {!secondary && ( + + )} +
@@ -357,15 +366,6 @@ function NewsCard({ item, secondary = false }: { item: NewsItem; secondary?: boo -
- {formatRelativeTime(item.publishedAt)} - {!secondary && ( - - )} -
{item.summary && !secondary && ( diff --git a/components/YieldsTab.tsx b/components/YieldsTab.tsx index 67cfdd2..273ff10 100644 --- a/components/YieldsTab.tsx +++ b/components/YieldsTab.tsx @@ -1,7 +1,7 @@ "use client"; import { useMemo } from "react"; -import { TrendingUp, TrendingDown, Minus, ArrowRight } from "lucide-react"; +import { TrendingUp, TrendingDown, Minus } from "lucide-react"; // ── Types ───────────────────────────────────────────────────────────────────── @@ -107,89 +107,67 @@ export default function YieldsTab({ yieldsData, fxDayPct }: Props) { {sorted[0][0]} {fmt(maxYield)} ↑ max | {sorted.at(-1)![0]} {fmt(sorted.at(-1)![1])} ↓ min + {topCarry[0] && ( + <> + | + + ★ Top carry : {topCarry[0].long}→{topCarry[0].short} +{topCarry[0].bps}bp + + + )} - {/* ── Classement Yield 10Y ────────────────────────────────────────────── */} -
-

- Classement Yield 10Y -

-
- {sorted.map(([ccy, yld], i) => { - const pct = maxYield > 0 ? (yld / maxYield) * 100 : 0; - const delta = dayDeltas[ccy] ?? null; - const isMax = i === 0; - const isMin = i === sorted.length - 1; - const barColor = isMax - ? "bg-emerald-500" - : isMin - ? "bg-sky-400" - : yld > 3.5 ? "bg-green-500" - : yld > 2 ? "bg-yellow-500" - : "bg-sky-500"; - - return ( -
-
- {CCY_FLAGS[ccy]} - {ccy} - {isMax && MAX} - {isMin && MIN} -
- -
-
-
- -
- {fmt(yld)} -
- -
- {deltaIcon(delta)} - {delta !== null ? (delta >= 0 ? "+" : "") + delta.toFixed(3) : "—"} -
-
- ); - })} -
-
- - {/* ── Carry Trade + Movers ────────────────────────────────────────────── */} + {/* ── Classement Yield 10Y + Movers côte à côte ──────────────────────── */}
- {/* Top Carry — compact */} + {/* Classement Yield 10Y */}

- 🚀 Top Carry Trade + Classement Yield 10Y

-
- {topCarry.map(({ long, short, bps }, i) => { - const { label, color } = carryStrength(bps); +
+ {sorted.map(([ccy, yld], i) => { + const pct = maxYield > 0 ? (yld / maxYield) * 100 : 0; + const delta = dayDeltas[ccy] ?? null; + const isMax = i === 0; + const isMin = i === sorted.length - 1; + const barColor = isMax + ? "bg-emerald-500" + : isMin + ? "bg-sky-400" + : yld > 3.5 ? "bg-green-500" + : yld > 2 ? "bg-yellow-500" + : "bg-sky-500"; + return ( -
- {i === 0 && } - {i !== 0 && {i + 1}} - {CCY_FLAGS[long]} - {long} - - {CCY_FLAGS[short]} - {short} - +{bps}bp - - {label} - +
+
+ {CCY_FLAGS[ccy]} + {ccy} + {isMax && MAX} + {isMin && MIN} +
+ +
+
+
+ +
+ {fmt(yld)} +
+ +
+ {deltaIcon(delta)} + {delta !== null ? (delta >= 0 ? "+" : "") + delta.toFixed(3) : "—"} +
); })}
-

- Long haut yield · Short bas yield · Emprunter la devise bon marché -

- {/* Movers du jour — renforcé */} + {/* Movers du jour */}

📊 Movers du Jour — Yield 10Y