International lottery stats layer, fed by LokiLab's army-feed API (results, Loki's picks, lifetime win record, army size). One mascot reskinned per country via flag-derived colors; Québec is the first locale, same pattern every future country will follow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
70 lines
2.8 KiB
TypeScript
70 lines
2.8 KiB
TypeScript
import { countryTheme } from '@/lib/countries'
|
|
import { getArmyFeed } from '@/lib/lokilab-feed'
|
|
|
|
export const instant = false
|
|
|
|
export default async function Home() {
|
|
const feed = await getArmyFeed()
|
|
const theme = countryTheme('CA-QC')
|
|
|
|
return (
|
|
<main className="flex flex-1 flex-col items-center px-6 py-16">
|
|
<div className="w-full max-w-3xl space-y-8">
|
|
<header className="text-center">
|
|
<h1 className="text-4xl font-bold tracking-tight" style={{ color: theme.primary }}>
|
|
LokiLoto
|
|
</h1>
|
|
<p className="mt-2 text-zinc-600">
|
|
{feed.army.total.toLocaleString('fr-CA')} membres dans l'armée · stats et pronostics de Loki, pays par pays
|
|
</p>
|
|
</header>
|
|
|
|
<section
|
|
className="rounded-2xl border p-6"
|
|
style={{ borderColor: theme.secondary + '30', background: theme.primary + '08' }}
|
|
>
|
|
<div className="mb-4 flex items-center gap-2">
|
|
<span className="text-2xl">{theme.flagEmoji}</span>
|
|
<h2 className="text-xl font-semibold" style={{ color: theme.secondary }}>
|
|
{theme.name}
|
|
</h2>
|
|
<span className="ml-auto text-sm text-zinc-500">
|
|
{(feed.army.byCountry[theme.code] ?? 0).toLocaleString('fr-CA')} membres
|
|
</span>
|
|
</div>
|
|
|
|
<div className="grid gap-3 sm:grid-cols-2">
|
|
{feed.lotteries
|
|
.filter((l) => l.country === theme.code)
|
|
.map((l) => (
|
|
<div key={l.id} className="rounded-xl border border-zinc-200 bg-white p-4">
|
|
<div className="flex items-center justify-between">
|
|
<span className="font-medium">{l.name}</span>
|
|
<span className="text-xs text-zinc-500">
|
|
{l.lifetime.wins}/{l.lifetime.picksTracked} gains
|
|
</span>
|
|
</div>
|
|
{l.lastDraw && (
|
|
<div className="mt-2 text-sm text-zinc-600">
|
|
<div>Dernier tirage {l.lastDraw.date} : {l.lastDraw.result.join(' - ')}</div>
|
|
{l.lastDraw.pick && (
|
|
<div style={{ color: l.lastDraw.won ? '#188653' : theme.secondary }}>
|
|
Choix de Loki : {l.lastDraw.pick.join(' - ')}
|
|
{l.lastDraw.won ? ' — gagnant' : ` — ${l.lastDraw.matched} correspondance(s)`}
|
|
</div>
|
|
)}
|
|
</div>
|
|
)}
|
|
</div>
|
|
))}
|
|
</div>
|
|
</section>
|
|
|
|
<p className="text-center text-xs text-zinc-400">
|
|
Données fournies par LokiLab. Statistiques descriptives seulement — aucune garantie de gain.
|
|
</p>
|
|
</div>
|
|
</main>
|
|
)
|
|
}
|