From df5abfc272a151c51f0e5e82214cf7aff8cfa880 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Fri, 19 Jul 2024 19:05:55 +0900
Subject: initial commit

---
 frontend/src/game/apps/Finished.jsx | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 frontend/src/game/apps/Finished.jsx

(limited to 'frontend/src/game/apps/Finished.jsx')

diff --git a/frontend/src/game/apps/Finished.jsx b/frontend/src/game/apps/Finished.jsx
new file mode 100644
index 0000000..efd4e81
--- /dev/null
+++ b/frontend/src/game/apps/Finished.jsx
@@ -0,0 +1,24 @@
+export default ({ result }) => {
+  const { yourScore, opponentScore } = result;
+  const yourScoreToCompare = yourScore ?? Infinity;
+  const opponentScoreToCompare = opponentScore ?? Infinity;
+  const resultText = yourScoreToCompare === opponentScoreToCompare ? '引き分け' : (yourScoreToCompare < opponentScoreToCompare ? 'あなたの勝ち' : 'あなたの負け');
+  return (
+    <>
+      <div>
+        対戦終了
+      </div>
+      <div>
+        <div>
+          {resultText}
+        </div>
+        <div>
+          あなたのスコア: {yourScore ?? 'なし'}
+        </div>
+        <div>
+          相手のスコア: {opponentScore ?? 'なし'}
+        </div>
+      </div>
+    </>
+  );
+}
-- 
cgit v1.3.1

