render()

in src/utils/AuthButton.js [79:110]


  render() {
    const {
      perms,
      noAuth,
      children,
      global: { permissions },
    } = this.props;
    const authButton = checkButtonAuth(perms, permissions);
    if (authButton) {
      if (authButton.icon) {
        const type = children.type;
        if (type === Button) {
          return React.cloneElement(children, { icon: authButton.icon });
        } else if (
          type === Popconfirm &&
          children.props.children &&
          children.props.children.type === Button
        ) {
          let newChildren = React.cloneElement(children.props.children, {
            icon: authButton.icon,
          });
          return React.cloneElement(children, { children: newChildren });
        } else {
          return children;
        }
      } else {
        return children;
      }
    } else {
      return noAuth || null;
    }
  }