"use client"; import { useBlitzGame } from "../../lib/useBlitzGame"; import { ArticleView } from "./ArticleView"; function fmtLeft(s: number): string { const m = Math.floor(s / 60); const sec = Math.floor(s % 60); return `${m}:${String(sec).padStart(2, "0")}`; } export function BlitzScreen({ onBack }: { onBack: () => void }) { const game = useBlitzGame(); const btnPrimary = "w-full min-h-11 rounded-xl text-sm font-semibold bg-[#7c3aed] text-white hover:bg-[#6d28d9] disabled:opacity-50 cursor-pointer transition-colors"; const btnGhost = "w-full min-h-11 rounded-xl text-sm font-semibold bg-[#242424] border border-[#2e2e2e] text-[#f0f0f0] hover:bg-[#1a1a1a] cursor-pointer transition-colors"; const danger = game.timeLeft < 30; if (game.phase === "setup") return (

Mode Blitz

Tu as 2 minutes pour visiter un maximum d'articles Wikipedia différents en cliquant sur les liens. Ton score = nombre d'articles uniques visités.

); if (game.phase === "ended") return (

Temps écoulé !

{game.visited.length} articles visités
{game.clicks} clics
{game.visited.map((t, i) => ( {i > 0 && } {t} ))}
); // Playing return (
{game.title &&

{game.title}

} {game.loading && (
Chargement...
)} {game.loadError && (

{game.loadError}

)} {!game.loading && !game.loadError && game.html && ( )}
{/* Bottom bar */}
⚡ Articles {game.visited.length}
Clics {game.clicks}
{/* Timer */}
{fmtLeft(game.timeLeft)}
{game.visited.length > 0 ? game.visited[game.visited.length - 1] : ""}
); }