import { PlayerInfo } from "../../models/PlayerInfo"; import BorderedContainer from "../BorderedContainer"; import CodeBlock from "../Gaming/CodeBlock"; import ScoreBar from "../Gaming/ScoreBar"; import SubmitResult from "../Gaming/SubmitResult"; import UserIcon from "../UserIcon"; type Props = { gameDisplayName: string; gameDurationSeconds: number; leftTimeSeconds: number; playerInfoA: PlayerInfo; playerInfoB: PlayerInfo; problemTitle: string; problemDescription: string; gameResult: "winA" | "winB" | "draw" | null; }; export default function GolfWatchAppGaming({ gameDisplayName, gameDurationSeconds, leftTimeSeconds, playerInfoA, playerInfoB, problemTitle, problemDescription, gameResult, }: Props) { const leftTime = (() => { const k = gameDurationSeconds + leftTimeSeconds; if (k <= 0) { return "00:00"; } const m = Math.floor(k / 60); const s = k % 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-iosdc-japan"; return (