import { useAtomValue } from "jotai"; import type { components } from "../../api/schema"; import { gamingLeftTimeSecondsAtom } from "../../states/watch"; import BorderedContainer from "../BorderedContainer"; import UserLabel from "../UserLabel"; type RankingEntry = components["schemas"]["RankingEntry"]; type Props = { gameDisplayName: string; ranking: RankingEntry[]; problemTitle: string; problemDescription: string; gameResult: "winA" | "winB" | "draw" | null; }; export default function GolfWatchAppGamingMultiplayer({ gameDisplayName, ranking, problemTitle, problemDescription, gameResult, }: Props) { const leftTimeSeconds = useAtomValue(gamingLeftTimeSecondsAtom)!; const leftTime = (() => { const m = Math.floor(leftTimeSeconds / 60); const s = leftTimeSeconds % 60; return `${m.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`; })(); const topBg = gameResult ? gameResult === "winA" ? "bg-orange-400" : gameResult === "winB" ? "bg-purple-400" : "bg-pink-500" : "bg-sky-600"; return (
{problemDescription}
| 順位 | 名前 | スコア |
|---|---|---|
| {index + 1} |
{entry.player.display_name}
{entry.player.label && (
|
{entry.score} |