// Historique public des parties d'une room. const SERVER_URL = import.meta.env.VITE_SERVER_URL ?? "http://localhost:3001" export interface GameHistoryEntry { id: string playedAt: string modes: string[] results: { name: string; score: number }[] } export async function fetchHistory(code: string): Promise { try { const res = await fetch(`${SERVER_URL}/api/history/${code}`) if (!res.ok) { return [] } return (await res.json()) as GameHistoryEntry[] } catch { return [] } }