summaryrefslogtreecommitdiff
path: root/frontend/src/components/game-browser/GameStatus.tsx
diff options
context:
space:
mode:
authorJoffrey BION <joffrey.bion@gmail.com>2019-05-05 20:31:41 +0200
committerjbion <joffrey.bion@amadeus.com>2019-05-06 18:33:15 +0200
commit664f7a98b44a561d619cc14235335e2a6f2bceb3 (patch)
treefd1c26ccd24b4dee26a2d412f8bdd4ba61b6fe42 /frontend/src/components/game-browser/GameStatus.tsx
parentConvert game components to TypeScript (diff)
downloadseven-wonders-664f7a98b44a561d619cc14235335e2a6f2bceb3.tar.gz
seven-wonders-664f7a98b44a561d619cc14235335e2a6f2bceb3.tar.bz2
seven-wonders-664f7a98b44a561d619cc14235335e2a6f2bceb3.zip
Migrate game-browser components to TypeScript
Diffstat (limited to 'frontend/src/components/game-browser/GameStatus.tsx')
-rw-r--r--frontend/src/components/game-browser/GameStatus.tsx17
1 files changed, 17 insertions, 0 deletions
diff --git a/frontend/src/components/game-browser/GameStatus.tsx b/frontend/src/components/game-browser/GameStatus.tsx
new file mode 100644
index 00000000..5f237258
--- /dev/null
+++ b/frontend/src/components/game-browser/GameStatus.tsx
@@ -0,0 +1,17 @@
+import { Tag } from '@blueprintjs/core';
+import { Intent } from '@blueprintjs/core';
+import * as React from 'react';
+import { ApiGameState } from '../../api/model';
+
+type GameStatusProps = {
+ state: ApiGameState,
+}
+
+export const GameStatus = ({state}: GameStatusProps) => (
+ <Tag minimal intent={statusIntents[state]}>{state}</Tag>
+);
+
+const statusIntents = {
+ 'LOBBY': Intent.SUCCESS,
+ 'PLAYING': Intent.WARNING,
+};
bgstack15