import Link from "next/link"
import { NumberSequence } from "@/components/number-sequence"
import { FollowButton } from "@/components/follow-button"
import type { LotteryFeedEntry } from "@/lib/lokilab-feed"
export function LotteryRow({
entry,
country,
isFollowing,
isAuthenticated,
}: {
entry: LotteryFeedEntry
country: string
isFollowing: boolean
isAuthenticated: boolean
}) {
const { lifetime, lastDraw } = entry
const resultSet = new Set(lastDraw?.result ?? [])
return (
{lastDraw && (
)}
{entry.name}
{lastDraw && (
{formatDate(lastDraw.date)}
)}
{lastDraw ? : }
{lastDraw?.pick ? (
) : (
Aucun choix pour ce tirage
)}
{lastDraw?.pick ? (
{lastDraw.matched} / {lastDraw.result.length}
) : (
)}
{lifetime.picksTracked > 0 ? (
<>
{(lifetime.winRate * 100).toFixed(0)}%
sur {lifetime.picksTracked} grilles
>
) : (
Nouveau
)}
)
}
function Dash() {
return —
}
function formatDate(iso: string): string {
const d = new Date(iso + "T00:00:00")
return d.toLocaleDateString("fr-CA", { day: "numeric", month: "short" })
}