/* soccerarena.ai — desktop: consensus + matches + footer + app shell. */
function ConsensusPanel() {
if (!ARENA.consensus || ARENA.consensus.length === 0) return null;
return (
TODAY'S CONSENSUS · AGGREGATED ACROSS {ARENA.models.length} MODELS
{ARENA.consensus.map((c, i) => (
{c.emoji}
{c.label.toUpperCase()}
{c.flag && {c.flag}}
{c.value}
{c.share}
{c.sub}
))}
);
}
function useRelativeTime(kickoffAt) {
const [label, setLabel] = React.useState(() => computeLabel(kickoffAt));
React.useEffect(() => {
const id = setInterval(() => setLabel(computeLabel(kickoffAt)), 30000);
return () => clearInterval(id);
}, [kickoffAt]);
return label;
}
function computeLabel(isoString) {
if (!isoString) return '';
const diff = new Date(isoString).getTime() - Date.now();
if (diff <= 0) return 'live';
const h = Math.floor(diff / 3600000);
const m = Math.floor((diff % 3600000) / 60000);
if (h < 24) return `${h}h ${m}m`;
const d = new Date(isoString);
return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' });
}
function MatchPredictions() {
const matches = (ARENA.matches || []).slice(0, 4);
return (
{matches.length === 0 ? (
No upcoming fixtures scheduled.
) : (
{matches.map((mt, i) => )}
)}
);
}
function MatchCard({ mt, idx }) {
const [hover, setHover] = React.useState(false);
const relTime = useRelativeTime(mt.kickoffAt);
const label = (n, kind) => n > 0
?
{n} {kind === 'home' ? mt.home.code : kind === 'away' ? mt.away.code : 'DRAW'}
: null;
return (
setHover(true)} onMouseLeave={() => setHover(false)}
style={{ display: 'block', background: hover ? SA.surface : SA.turf, padding: '16px 20px', transition: 'background 120ms', textDecoration: 'none' }}>
{mt.group.toUpperCase()}
{mt.kickoff}
· in {relTime}
{mt.home.flag}
{mt.home.name}
vs
{mt.away.name}
{mt.away.flag}
{label(mt.split.home, 'home')}
{label(mt.split.draw, 'draw')}
{label(mt.split.away, 'away')}
Match detail →
);
}
function DeskFooter() {
return (
);
}
function DesktopApp({ countdown }) {
return (
);
}
Object.assign(window, { ConsensusPanel, MatchPredictions, DeskFooter, DesktopApp });