From a46f583437e9b66ebec6fa22e27567a71b17b497 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sun, 21 Jul 2024 16:13:58 +0900
Subject: react router

---
 frontend/src/routes/golf/play/apps/Gaming.tsx | 34 +++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 frontend/src/routes/golf/play/apps/Gaming.tsx

(limited to 'frontend/src/routes/golf/play/apps/Gaming.tsx')

diff --git a/frontend/src/routes/golf/play/apps/Gaming.tsx b/frontend/src/routes/golf/play/apps/Gaming.tsx
new file mode 100644
index 0000000..27488e3
--- /dev/null
+++ b/frontend/src/routes/golf/play/apps/Gaming.tsx
@@ -0,0 +1,34 @@
+import React from 'react';
+
+type Props = {
+  gameId: number;
+  playerId: number;
+  problem: string | null;
+  onCodeChange: (data: { code: string }) => void;
+  score: number | null;
+};
+
+export default ({ problem, onCodeChange, score }: Props) => {
+  const handleTextChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
+    onCodeChange({ code: e.target.value });
+  };
+
+  return (
+    <div style={{ display: 'flex' }}>
+      <div style={{ flex: 1, padding: '10px', borderRight: '1px solid #ccc' }}>
+        <div>
+          {problem}
+        </div>
+        <div>
+          {score == null ? 'Score: -' : `Score: ${score} byte`}
+        </div>
+      </div>
+      <div style={{ flex: 1, padding: '10px' }}>
+        <textarea
+          style={{ width: '100%', height: '100%' }}
+          onChange={handleTextChange}
+        />
+      </div>
+    </div>
+  );
+};
-- 
cgit v1.2.3-70-g09d2

