/*
 * @Author: zhangleyuan
 * @Date: 2021-02-20 16:45:51
 * @LastEditors: zhangleyuan
 * @LastEditTime: 2021-03-01 16:43:16
 * @Description: 描述一下
 * @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
 */
import React from 'react';
import { Button } from 'antd';
import { withRouter } from 'react-router-dom';
import User from '@/common/js/user';
import './PlanOpt.less';

const userRole =  User.getUserRole();
function PlanOpt() {
  function  handleCreatePlan(){
    window.RCHistory.push({
      pathname: '/create-plan?type=add',
    })
  }
  return (
    <div className="plan-opt">
      { (userRole === "CloudManager" || userRole === "StoreManager") &&
          <Button
            type="primary"
            className="mr12"
            onClick={handleCreatePlan}
          >新建培训计划</Button>
      }
    </div>
  );
}
export default withRouter(PlanOpt)
