import { UserFavorite } from 'requests'

import { Name } from 'features/Name'

import { TooltipWrapper } from './styled'

import { SuperTournament } from '../hooks'

type TooltipBlockProps = {
  favorite?: UserFavorite,
  superTournament?: SuperTournament,
  topPosition: number,
}

export const FavoritesToolip = ({
  favorite,
  superTournament,
  topPosition,
}: TooltipBlockProps) => (
  <TooltipWrapper top={topPosition}>
    <Name nameObj={superTournament ?? favorite?.info!} />
  </TooltipWrapper>
)
