import React, { Fragment } from 'react'

import { ProfileTypes } from 'config'

import { ProfileCard } from 'features/ProfileCard'
import { Matches } from 'features/Matches'

import { useTournamentPage } from './hooks'
import { Content } from './styled'

export const TournamentPage = () => {
  const {
    infoItems,
    name,
    requestArgs,
  } = useTournamentPage()

  return (
    <Fragment>
      <Content>
        <ProfileCard
          profileType={ProfileTypes.TOURNAMENTS}
          name={name}
          infoItems={infoItems}
        />
        <Matches requestArgs={requestArgs} />
      </Content>
    </Fragment>
  )
}
