diff options
author | Joffrey BION <joffrey.bion@gmail.com> | 2019-05-05 20:31:41 +0200 |
---|---|---|
committer | jbion <joffrey.bion@amadeus.com> | 2019-05-06 18:33:15 +0200 |
commit | 664f7a98b44a561d619cc14235335e2a6f2bceb3 (patch) | |
tree | fd1c26ccd24b4dee26a2d412f8bdd4ba61b6fe42 /frontend/src/components/game-browser/GameStatus.tsx | |
parent | Convert game components to TypeScript (diff) | |
download | seven-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.tsx | 17 |
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, +}; |