summaryrefslogtreecommitdiff
path: root/frontend/src/components/PlayerList.jsx
blob: 8584502b5f7ad3e3958241a4241fd00231b22640 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@flow
import { Text } from '@blueprintjs/core';
import { List } from 'immutable';
import React from 'react';
import { Flex } from 'reflexbox';
import { Player } from '../models/players';

export type PlayerListProps = {
  players: List<Player>;
};

const PlayerItem = ({player}) => (
  <Flex>
    <Text>{player.displayName}</Text>
    <Text>({player.username})</Text>
  </Flex>
);

export const PlayerList = ({players}: PlayerListProps) => (
  <div>
    {players.map(player => <PlayerItem key={player.username} player={player}/>)}
  </div>
);
bgstack15