Files
Nazim KriandClaude Opus 5.5 9996f7b823 Restructure navigation after 1xbet: utility bar, lottery strip, right rail
User feedback: still ugly, the 1xbet navigation was never actually
reproduced. Now follows its structure:
- thin utility bar on top (country picker, Connexion + Inscription)
  above the main bar (logo, nav)
- horizontal icon strip of the country's lotteries under the header,
  with the active one underlined in gold
- compact promo banner instead of a full-height hero, so results stay
  above the fold
- right rail in the bet-slip position: top-5 leaderboard and army stats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 15:41:16 -04:00

53 lines
2.3 KiB
TypeScript

import Link from "next/link"
import { Trophy, Users } from "lucide-react"
import { leaderboard } from "@/lib/follows"
/** Right rail, 1xbet "bet slip" position — here the live leaderboard and army stats. */
export async function SideRail({ armyTotal, globalWins }: { armyTotal: number; globalWins: number }) {
const top = await leaderboard(5)
return (
<aside className="space-y-3">
<div className="overflow-hidden rounded-lg border border-border bg-card">
<div className="flex items-center gap-2 border-b border-border bg-gold/10 px-4 py-2.5">
<Trophy className="h-4 w-4 text-gold" />
<h2 className="text-sm font-semibold">Classement</h2>
</div>
{top.length === 0 ? (
<p className="px-4 py-5 text-xs leading-relaxed text-muted-foreground">
Personne au classement pour l&apos;instant. Suivez un choix de Loki (★) pour y entrer.
</p>
) : (
<ol className="divide-y divide-border/60">
{top.map((s, i) => (
<li key={s.userId} className="flex items-center gap-3 px-4 py-2 text-sm">
<span className="w-4 text-xs text-muted-foreground tabular-nums">{i + 1}</span>
<span className="flex-1 truncate">{s.displayName}</span>
<span className="font-semibold tabular-nums text-gold">{(s.winRate * 100).toFixed(0)}%</span>
</li>
))}
</ol>
)}
<Link href="/classement" className="block border-t border-border px-4 py-2 text-center text-xs text-gold hover:bg-gold/5">
Voir tout le classement
</Link>
</div>
<div className="grid grid-cols-2 gap-3">
<RailStat icon={Users} value={armyTotal.toLocaleString("fr-CA")} label="Membres" />
<RailStat icon={Trophy} value={globalWins.toString()} label="Grilles gagnées" />
</div>
</aside>
)
}
function RailStat({ icon: Icon, value, label }: { icon: typeof Users; value: string; label: string }) {
return (
<div className="rounded-lg border border-border bg-card px-3 py-3">
<Icon className="h-4 w-4 text-gold" />
<p className="mt-1.5 font-display text-xl leading-none tabular-nums">{value}</p>
<p className="mt-1 text-[11px] text-muted-foreground">{label}</p>
</div>
)
}