import React from 'react';

function Profile({children,sureFunc,showCompeleteDialog , completeProfile, className,checkIfLogin,showLoginDialog,checklogin}) {
  
  function checkProfile() {
    if(checklogin){
      if(checkIfLogin()===false){
        showLoginDialog();
        return;
      }
    }
    if(!completeProfile){
      showCompeleteDialog && showCompeleteDialog();
    }else{
      sureFunc();
    }
  }

  return(
    <a className={className} onClick={checkProfile}>{children}</a>
  )
}
export default Profile;