import type { Metadata } from "next"; import Link from "next/link"; import { ArrowLeft, ArrowRight, Search } from "lucide-react"; import { Header, Footer } from "@/components/Shell"; import { LeaderboardEmpty, LeaderboardTable, WinnersPodium, } from "@/components/Leaderboard"; import { PixelTrophy } from "@/components/PixelArt"; import { leaderboard } from "@/lib/leaderboard"; import { user } from "@/lib/supabase"; import { formatScore, leaderboardDifficulties, leaderboardFilters, leaderboardHref, } from "@/shared/leaderboard"; export const dynamic = "force-dynamic"; export const metadata: Metadata = { title: "Leaderboard", description: "Meet MineGeo’s top explorers. Compare the best five-round scores across easy, normal, and hard Minecraft expeditions.", }; export default async function LeaderboardPage({ searchParams, }: { searchParams: Promise>; }) { const { difficulty, search, page } = leaderboardFilters(await searchParams); const [data, account] = await Promise.all([ leaderboard({ difficulty, search, page }), user(), ]); return ( <>
Back to home
THE EXPLORERS’ BOARD

Every block counts.

The sharpest eyes in the Overworld.
Five rounds. 25,000 possible points. Where do you stand?

All time
{data ? ( <> {data.leaders.length > 0 && !search && data.page === 1 && ( )}

The rankings

{formatScore(data.total_players)}{" "} {data.total_players === 1 ? "explorer" : "explorers"} ·{" "} {formatScore(data.total_games)} completed{" "} {data.total_games === 1 ? "expedition" : "expeditions"}

{difficulty !== "all" && ( )}
{search && (
{formatScore(data.matching_players)}{" "} {data.matching_players === 1 ? "result" : "results"} for “ {search}” Clear search ×
)} {data.entries.length ? ( ) : ( )} {data.matching_players > 0 && (
Showing {formatScore((data.page - 1) * 25 + 1)}– {formatScore( Math.min(data.page * 25, data.matching_players), )}{" "} of {formatScore(data.matching_players)}
)}
) : ( )}