import toNumber from 'lodash/toNumber'
import isUndefined from 'lodash/isUndefined'
import includes from 'lodash/includes'

export const isMatchPage = () => {
  const splitPath = window.location.pathname.split('/')
  const pageType = splitPath[2]
  const matchId = toNumber(splitPath[3])

  return pageType === 'matches' && !isUndefined(matchId)
}

export const isMatchPageRFEF = () => {
  const splitPath = window.location.pathname.split('/')
  const pageType = splitPath[1]

  return pageType === '1rfef'
}

export const isDiwanInsportsTvPage = () => includes(window.location.host, 'diwan')
