From 1e6df136d8202c8adf65948527f4c3e7583b338c Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Tue, 4 Mar 2025 22:55:01 +0900
Subject: websocket to polling

---
 .../app/components/GolfPlayApps/GolfPlayAppGaming.tsx   | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

(limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx')

diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
index d4a059f..bc205fb 100644
--- a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
+++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
@@ -5,10 +5,11 @@ import SubmitButton from "../../components/SubmitButton";
 import {
 	gamingLeftTimeSecondsAtom,
 	scoreAtom,
-	submitResultAtom,
+	statusAtom,
 } from "../../states/play";
 import type { PlayerProfile } from "../../types/PlayerProfile";
 import BorderedContainer from "../BorderedContainer";
+import CodeBlock from "../Gaming/CodeBlock";
 import SubmitResult from "../Gaming/SubmitResult";
 import UserIcon from "../UserIcon";
 
@@ -17,6 +18,7 @@ type Props = {
 	playerProfile: PlayerProfile;
 	problemTitle: string;
 	problemDescription: string;
+	sampleCode: string;
 	initialCode: string;
 	onCodeChange: (code: string) => void;
 	onCodeSubmit: (code: string) => void;
@@ -27,13 +29,14 @@ export default function GolfPlayAppGaming({
 	playerProfile,
 	problemTitle,
 	problemDescription,
+	sampleCode,
 	initialCode,
 	onCodeChange,
 	onCodeSubmit,
 }: Props) {
 	const leftTimeSeconds = useAtomValue(gamingLeftTimeSecondsAtom)!;
 	const score = useAtomValue(scoreAtom);
-	const submitResult = useAtomValue(submitResultAtom);
+	const status = useAtomValue(statusAtom);
 
 	const textareaRef = useRef<HTMLTextAreaElement>(null);
 
@@ -80,10 +83,16 @@ export default function GolfPlayAppGaming({
 			<div className="grow grid grid-cols-3 divide-x divide-gray-300">
 				<div className="p-4">
 					<div className="mb-2 text-xl font-bold">{problemTitle}</div>
-					<div className="p-2">
+					<div className="p-2 grid gap-4">
 						<BorderedContainer>
 							<div className="text-gray-700">{problemDescription}</div>
 						</BorderedContainer>
+						<BorderedContainer>
+							<div>
+								<h2>サンプルコード</h2>
+								<CodeBlock code={sampleCode} language="php" />
+							</div>
+						</BorderedContainer>
 					</div>
 				</div>
 				<div className="p-4">
@@ -96,7 +105,7 @@ export default function GolfPlayAppGaming({
 				</div>
 				<div className="p-4">
 					<SubmitResult
-						result={submitResult}
+						status={status}
 						submitButton={
 							<SubmitButton onClick={handleSubmitButtonClick}>
 								提出
-- 
cgit v1.2.3-70-g09d2

