import { useTypedSelector } from '../redux/rootReducer'
import { selectTalentProfile } from '../redux/User/selector'
import { profileLink } from '../components/PreviewLayoutHeader/utils'

export function useCurrentTalentSiteLink({
  hideProtocol = false
}: { hideProtocol?: boolean } = {}): string {
  const talentProfile = useTypedSelector(selectTalentProfile)
  return profileLink(talentProfile?.user?.username, { hideProtocol })
}
