import type { PlayerScore, RoomSnapshot } from "@nerdware/shared" interface ScoreboardProps { scores: PlayerScore[] snapshot: RoomSnapshot playerId: string | null } export function Scoreboard({ scores, snapshot, playerId }: ScoreboardProps) { const nameOf = (id: string) => snapshot.players.find((p) => p.id === id)?.name ?? "?" const ranked = [...scores].sort((a, b) => b.score - a.score) return (