aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/routes/golf/play/apps/Gaming.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/routes/golf/play/apps/Gaming.tsx')
-rw-r--r--frontend/src/routes/golf/play/apps/Gaming.tsx34
1 files changed, 34 insertions, 0 deletions
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>
+ );
+};