(async function(){ const tournaments = await SSAPI.get('/tournaments').catch(()=>[]); const matches = await SSAPI.get('/matches').catch(()=>[]); const tWrap = document.getElementById('tournaments'); tWrap.innerHTML = tournaments.map(t=>`
${t.name}
${t.location || ''}
${t.start_date} → ${t.end_date}
`).join('') || '

Aucun tournoi

'; const mWrap = document.getElementById('matches'); mWrap.innerHTML = matches.map(m=>`
${m.round || 'Match'} — ${m.court || 'Court ?'}
Teams: ${m.team_a_id || '?'} vs ${m.team_b_id || '?'}
Score: ${m.score_a} - ${m.score_b} (${m.status})
${m.scheduled_at ? new Date(m.scheduled_at).toLocaleString() : ''}
`).join('') || '

Aucun match

'; })();