import { useSelector } from 'react-redux';

import useUserInfo from '@/hooks/use-user-info';
import { selectPartnerInfo } from '@/store/selector/partner';

function useInviteCode() {
  const data = useSelector(selectPartnerInfo);
  const userInfo = useUserInfo();
  return userInfo?.isPartner ? data?.inviteCode : undefined;
}

export default useInviteCode;
