Files
TheGame/packages/web/components/Player/PlayerFeatures.tsx
2020-10-16 11:04:22 -06:00

53 lines
1.6 KiB
TypeScript

import { Container, Divider, MetaTag, Wrap } from '@metafam/ds';
import { PlayerFeature } from 'components/Player/PlayerFeature';
import { PlayerFragmentFragment } from 'graphql/autogen/types';
import React from 'react';
type Props = { player: PlayerFragmentFragment };
export const PlayerFeatures: React.FC<Props> = ({ player }) => {
return (
<Container maxW="xl">
<Wrap
spacing="8"
ml={{ base: '4', lg: '64' }}
pt={{ base: '4', md: '12', lg: 0 }}
>
<PlayerFeature
title="XP"
value={Math.floor(player.totalXp).toString()}
/>
<Divider orientation="vertical" color="whiteAlpha.400" />
<PlayerFeature title="Rank">
<MetaTag
backgroundColor={player.rank?.toLowerCase()}
size="md"
color="blackAlpha.600"
>
{player.rank}
</MetaTag>
</PlayerFeature>
<Divider orientation="vertical" color="whiteAlpha.400" />
{player.box_profile?.location && (
<PlayerFeature
title="Location"
value={player.box_profile?.location}
/>
)}
<Divider orientation="vertical" color="whiteAlpha.400" />
{/* <PlayerFeature title="Role" value="N/A" color="whiteAlpha.500" /> */}
{/* <Divider orientation="vertical" color="whiteAlpha.400" /> */}
<PlayerFeature
title="Availability"
value={
player.availability_hours != null
? `${player.availability_hours} hr / week`
: 'N/A'
}
color="whiteAlpha.500"
/>
</Wrap>
</Container>
);
};