import React from 'react'

import { ProfileTypes } from 'config'

import { ProfileHeader } from 'features/ProfileHeader'
import { ProfileCard } from 'features/ProfileCard'
import { Matches } from 'features/Matches'
import { UserFavorites } from 'features/UserFavorites'
import { MainWrapper } from 'features/MainWrapper'
import { MediaQuery } from 'features/MediaQuery'

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

export const TeamPage = () => {
  const {
    fetchMatches,
    infoItems,
    titleObj,
  } = useTeamPage()

  return (
    <MainWrapper>
      <MediaQuery minDevice='laptop'>
        <UserFavorites />
      </MediaQuery>
      <ProfileHeader />
      <Content>
        <ProfileCard
          profileType={ProfileTypes.TEAMS}
          titleObj={titleObj}
          infoItems={infoItems}
        />
        <Matches fetch={fetchMatches} />
      </Content>
    </MainWrapper>
  )
}
