// palmares.jsx — interactive trophy grid with country/decade/club filters // clubs.jsx merged in — the clubs journey list const { useState: useStateP, useMemo: useMemoP } = React; function Palmares({ t }) { const p = t.palm; const trophies = p.trophies; const [country, setCountry] = useStateP('ALL'); const [decade, setDecade] = useStateP('ALL'); const [club, setClub] = useStateP('ALL'); const countries = useMemoP(() => { const m = new Map(); trophies.forEach((tr) => { if (!m.has(tr.country)) m.set(tr.country, tr.flag); }); return Array.from(m.entries()); }, [trophies]); const decades = useMemoP(() => { const set = new Set(trophies.map((tr) => tr.decade)); return Array.from(set).sort(); }, [trophies]); const clubs = useMemoP(() => { const set = new Set(trophies.map((tr) => tr.club)); return Array.from(set); }, [trophies]); const filtered = trophies.filter((tr) => (country === 'ALL' || tr.country === country) && (decade === 'ALL' || tr.decade === decade) && (club === 'ALL' || tr.club === club) ); // Make sure the layout works even when fewer than 4 cards: don't force a hero card if // its trophy got filtered out. Keep hero styling only when libertadores/paulista are visible. return ( {p.eyebrow} {p.title_a} {p.title_b} {p.intro_a} {p.intro_b} {p.filter_country} setCountry('ALL')}>{p.filter_all} {countries.map(([code, flag]) => ( setCountry(code)}>{flag} ))} {p.filter_decade} setDecade('ALL')}>{p.filter_all} {decades.map((d) => ( setDecade(d)}>{d} ))} {p.filter_club} setClub('ALL')}>{p.filter_all} {clubs.map((cl) => ( setClub(cl)}>{cl} ))} {filtered.map((tr, i) => { const heroCls = tr.hero ? ' hero' : ''; const libCls = tr.comp.toLowerCase().includes('libertadores') ? ' libertadores' : ''; return ( {tr.marker && {tr.marker}} {tr.country} {tr.year} {tr.comp} {tr.club} {tr.ctx && {tr.ctx}} ); })} {p.showing} {filtered.length} {p.of} {trophies.length} {p.count_label.toLowerCase()} {p.count_label} · 1996 — 2025 ); } function Clubs({ t }) { const c = t.clubs; return ( {c.eyebrow} {c.title_a} {c.title_b} {c.intro} {c.rows.map((r, i) => ( {String(i + 1).padStart(2, '0')} {r.name} {r.period} {r.country} {r.titles > 0 ? r.titles : '—'} {r.titles > 0 ? c.titles_label : c.explore} → ))} ); } Object.assign(window, { Palmares, Clubs });
{tr.ctx}