import { faArrowDown } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Link } from "@remix-run/react"; import React, { useRef } from "react"; import SubmitButton from "../../components/SubmitButton"; import type { PlayerInfo } from "../../models/PlayerInfo"; import BorderedContainer from "../BorderedContainer"; import ExecStatusIndicatorIcon from "../ExecStatusIndicatorIcon"; import SubmitStatusLabel from "../SubmitStatusLabel"; type Props = { gameDisplayName: string; gameDurationSeconds: number; leftTimeSeconds: number; playerInfo: Omit; problemTitle: string; problemDescription: string; onCodeChange: (code: string) => void; onCodeSubmit: (code: string) => void; }; export default function GolfPlayAppGaming({ gameDisplayName, gameDurationSeconds, leftTimeSeconds, playerInfo, problemTitle, problemDescription, onCodeChange, onCodeSubmit, }: Props) { const textareaRef = useRef(null); const handleTextChange = (e: React.ChangeEvent) => { onCodeChange(e.target.value); }; const handleSubmitButtonClick = () => { if (textareaRef.current) { onCodeSubmit(textareaRef.current.value); } }; 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")}`; })(); return (
{gameDisplayName}
{leftTime}
{playerInfo.score}
Player 1
{playerInfo.displayName}
{playerInfo.iconPath && ( {`${playerInfo.displayName} )}
{problemTitle}
{problemDescription}
提出
    {playerInfo.submitResult.execResults.map((r, idx) => (
  • {idx !== playerInfo.submitResult.execResults.length - 1 && (
    )}
    {r.label}
    {r.stdout} {r.stderr}
  • ))}
); }