diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-12 02:11:30 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-12 03:57:56 +0900 |
| commit | 8cbb00ae115545a5803f6d08283985ca089d7e41 (patch) | |
| tree | aaea5583102fe6a15274ecbd85adf628b044ec92 /frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | |
| parent | 699c5ce665bae6bcc406a0f7de994bb218a9977e (diff) | |
| download | phperkaigi-2025-albatross-8cbb00ae115545a5803f6d08283985ca089d7e41.tar.gz phperkaigi-2025-albatross-8cbb00ae115545a5803f6d08283985ca089d7e41.tar.zst phperkaigi-2025-albatross-8cbb00ae115545a5803f6d08283985ca089d7e41.zip | |
feat: add `submitresult` message
Diffstat (limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx')
| -rw-r--r-- | frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx index 03acf5a..08490a6 100644 --- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx +++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx @@ -1,28 +1,25 @@ 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"; type Props = { gameDisplayName: string; - playerDisplayName: string; + playerInfo: Omit<PlayerInfo, "code">; problemTitle: string; problemDescription: string; onCodeChange: (code: string) => void; onCodeSubmit: (code: string) => void; - currentScore: number | null; - lastExecStatus: string | null; }; export default function GolfPlayAppGaming({ gameDisplayName, - playerDisplayName, + playerInfo, problemTitle, problemDescription, onCodeChange, onCodeSubmit, - currentScore, - lastExecStatus, }: Props) { const textareaRef = useRef<HTMLTextAreaElement>(null); @@ -45,7 +42,7 @@ export default function GolfPlayAppGaming({ </div> <div> <Link to={"/dashboard"} className="font-bold text-xl"> - {playerDisplayName} + {playerInfo.displayName} </Link> </div> </div> @@ -69,7 +66,7 @@ export default function GolfPlayAppGaming({ <SubmitButton onClick={handleSubmitButtonClick}>提出</SubmitButton> <div className="mb-2 mt-auto"> <div className="font-semibold text-green-500"> - Score: {currentScore ?? "-"} ({lastExecStatus ?? "-"}) + Score: {playerInfo.score ?? "-"} </div> </div> </div> |
