import { Icon, IconName, Intent } from '@blueprintjs/core';
import { List } from 'immutable';
import * as React from 'react';
import { ReactNode } from 'react';
import { Flex } from 'reflexbox';
import { ApiPlayer } from '../../api/model';
import { RadialList } from './radial-list/RadialList';
import roundTable from './round-table.png';
type PlayerItemProps = {
player: ApiPlayer
};
const PlayerItem = ({player}: PlayerItemProps) => (
{player.displayName}
);
const PlayerPlaceholder = () => (
?
);
type UserIconProps = {
isUser: boolean,
isOwner: boolean,
title: string | null,
};
const UserIcon = ({isUser, isOwner, title}: UserIconProps) => {
const icon: IconName = isOwner ? 'badge' : 'user';
const intent: Intent = isUser ? Intent.WARNING : Intent.NONE;
return ;
};
type RadialPlayerListProps = {
players: List
};
export const RadialPlayerList = ({players}: RadialPlayerListProps) => {
const orderedPlayers = placeUserFirst(players.toArray());
const playerItems = orderedPlayers.map(player => );
const tableImg = ;
return ;
};
function placeUserFirst(players: ApiPlayer[]): ApiPlayer[] {
while (!players[0].user) {
players.push(players.shift()!);
}
return players;
}
function completeWithPlaceholders(playerItems: Array): Array {
while (playerItems.length < 3) {
playerItems.push();
}
return playerItems;
}