aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-07-28 23:28:10 +0900
committernsfisis <nsfisis@gmail.com>2024-07-29 02:32:54 +0900
commitdf57e43059a230062d903f55f9af7339828875c3 (patch)
treebdce6908a7da4bbe5528e3fb3069eb489efa41d5 /frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
parentdaaf81ae931654e20f882fbc6bbc4a02cbfc0273 (diff)
downloadphperkaigi-2025-albatross-df57e43059a230062d903f55f9af7339828875c3.tar.gz
phperkaigi-2025-albatross-df57e43059a230062d903f55f9af7339828875c3.tar.zst
phperkaigi-2025-albatross-df57e43059a230062d903f55f9af7339828875c3.zip
feat(frontend): partially implement gaming
Diffstat (limited to 'frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx')
-rw-r--r--frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx30
1 files changed, 30 insertions, 0 deletions
diff --git a/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
new file mode 100644
index 0000000..332cb3c
--- /dev/null
+++ b/frontend/app/components/GolfPlayApps/GolfPlayAppGaming.tsx
@@ -0,0 +1,30 @@
+export default function GolfPlayAppGaming({
+ problem,
+ onCodeChange,
+ currentScore,
+}: {
+ problem: string;
+ onCodeChange: (code: string) => void;
+ currentScore: number | null;
+}) {
+ const handleTextChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
+ onCodeChange(e.target.value);
+ };
+
+ return (
+ <div style={{ display: "flex" }}>
+ <div style={{ flex: 1, padding: "10px", borderRight: "1px solid #ccc" }}>
+ <div>{problem}</div>
+ <div>
+ {currentScore == null ? "Score: -" : `Score: ${currentScore}`}
+ </div>
+ </div>
+ <div style={{ flex: 1, padding: "10px" }}>
+ <textarea
+ style={{ width: "100%", height: "100%" }}
+ onChange={handleTextChange}
+ />
+ </div>
+ </div>
+ );
+}