import { faArrowDown } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { PlayerInfo } from "../../models/PlayerInfo"; import BorderedContainer from "../BorderedContainer"; import ExecStatusIndicatorIcon from "../ExecStatusIndicatorIcon"; import SubmitStatusLabel from "../SubmitStatusLabel"; type Props = { gameDisplayName: string; gameDurationSeconds: number; leftTimeSeconds: number; playerInfoA: PlayerInfo; playerInfoB: PlayerInfo; problemTitle: string; problemDescription: string; }; export default function GolfWatchAppGaming({ gameDisplayName, gameDurationSeconds, leftTimeSeconds, playerInfoA, playerInfoB, }: Props) { const leftTime = (() => { const k = gameDurationSeconds + leftTimeSeconds; const m = Math.floor(k / 60); const s = k % 60; return `${m.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`; })(); const scoreRatio = (() => { const scoreA = playerInfoA.score; const scoreB = playerInfoB.score; if (scoreA === null && scoreB === null) { return 50; } else if (scoreA === null) { return 0; } else if (scoreB === null) { return 100; } else { return (scoreB / (scoreA + scoreB)) * 100; } })(); return (
{playerInfoA.iconPath && ( {`${playerInfoA.displayName} )}
Player 1
{playerInfoA.displayName}
{playerInfoA.score}
{gameDisplayName}
{leftTime}
{playerInfoB.score}
Player 2
{playerInfoB.displayName}
{playerInfoB.iconPath && ( {`${playerInfoB.displayName} )}
						{playerInfoA.code}
					
    {playerInfoA.submitResult.execResults.map((r, idx) => (
  • {idx !== playerInfoA.submitResult.execResults.length - 1 && (
    )}
    {r.label}
    {r.stdout} {r.stderr}
  • ))}
    {playerInfoB.submitResult.execResults.map((r, idx) => (
  • {idx !== playerInfoB.submitResult.execResults.length - 1 && (
    )}
    {r.label}
    {r.stdout} {r.stderr}
  • ))}
						{playerInfoB.code}
					
); }