import * as React from 'react'
import { ContextConsumer } from '../context'
import UsersContainer from './users-container'
import { TeamInvitationMode } from './users-toolbar'

import './users.scss'

export interface TeamProps {
  invitationMode: TeamInvitationMode;
  hideStatistics?: boolean;
}

export default class Team extends React.Component<TeamProps, {}> {
  render() {
    return (
      <ContextConsumer>
        {
          (context) => {
            return <UsersContainer
              invitationMode={this.props.invitationMode}
              hideStatistics={this.props.hideStatistics}
              context={context} />
          }
        }
      </ContextConsumer>
    )
  }
}