Country selector in the header, auto-detected and remembered

Replaces the left sidebar with a header dropdown (flag + name), like
1xbet's region picker. The shown country resolves as: saved choice
(cookie, then the member's profile so it follows them across devices),
else Cloudflare's CF-IPCountry (Canada maps to Québec), else Québec.
favoriteCountry becomes nullable so geo-detection isn't overridden by
a default nobody chose. Emoji flags render as letters on Windows, so
flags are now SVGs in /public/flags; country names are in French.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Nazim Kri
2026-10-30 09:58:33 -04:00
co-authored by Claude Opus 5.5
parent 2eafbfd3d7
commit e97b2e54ad
21 changed files with 200 additions and 162 deletions
+3 -2
View File
@@ -8,6 +8,7 @@ import { NumberFrequencyChart } from "@/components/number-frequency-chart"
import { PerformanceChart } from "@/components/performance-chart"
import { DrawTimeline } from "@/components/draw-timeline"
import { Badge } from "@/components/ui/badge"
import { Flag } from "@/components/flag"
export const instant = false
@@ -35,8 +36,8 @@ export default async function LotteryStatsPage({ params }: { params: Promise<{ i
<div className="mx-auto w-full max-w-4xl flex-1 px-4 py-6 sm:px-6">
<div className="flex flex-wrap items-center gap-2">
<h1 className="text-2xl font-bold tracking-tight">{entry.name}</h1>
<Badge variant="secondary">
{theme.flagEmoji} {theme.name}
<Badge variant="secondary" className="gap-1.5">
<Flag code={theme.code} /> {theme.name}
</Badge>
</div>
<p className="mt-1 text-sm text-muted-foreground">