import React, { Fragment } from 'react'

import { ProfileTypes } from 'config'

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

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

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

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