From 664f7a98b44a561d619cc14235335e2a6f2bceb3 Mon Sep 17 00:00:00 2001
From: Joffrey BION <joffrey.bion@gmail.com>
Date: Sun, 5 May 2019 20:31:41 +0200
Subject: Migrate game-browser components to TypeScript

---
 frontend/src/components/game-browser/GameStatus.tsx | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 frontend/src/components/game-browser/GameStatus.tsx

(limited to 'frontend/src/components/game-browser/GameStatus.tsx')

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,
+};
-- 
cgit 

