summaryrefslogtreecommitdiff
path: root/sw-ui/src/components/game-browser/GameStatus.tsx
blob: 5f237258d2fd8ae3c4f5c77c882f45c8b0474da2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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