aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/game/apps/Finished.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/game/apps/Finished.jsx')
-rw-r--r--frontend/src/game/apps/Finished.jsx24
1 files changed, 24 insertions, 0 deletions
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>
+ </>
+ );
+}