import _Button from "antd/es/button";
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["style", "mode", "title", "disabled", "size", "block", "ghost", "href", "danger", "loading", "shape", "btnSyle", "iconFlag", "btncolor", "block1", "btnFlag", "btnBgcolor", "btnBrcolor", "icon"];
import * as React from 'react';
import * as Icons from '@ant-design/icons/es/index';
import "./index.scss";
var antButton = function antButton(_ref) {
  var _ref$style = _ref.style,
    style = _ref$style === void 0 ? {} : _ref$style,
    mode = _ref.mode,
    title = _ref.title,
    disabled = _ref.disabled,
    size = _ref.size,
    block = _ref.block,
    ghost = _ref.ghost,
    href = _ref.href,
    danger = _ref.danger,
    loading = _ref.loading,
    shape = _ref.shape,
    btnSyle = _ref.btnSyle,
    iconFlag = _ref.iconFlag,
    btncolor = _ref.btncolor,
    block1 = _ref.block1,
    btnFlag = _ref.btnFlag,
    btnBgcolor = _ref.btnBgcolor,
    btnBrcolor = _ref.btnBrcolor,
    icon = _ref.icon,
    otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
  var _style = style || {};
  var _otherProps = otherProps || {};
  _otherProps.style = _style;
  // _otherProps.style.paddingRight = '0px'
  // _otherProps.style.paddingLfet = '0px'
  // _otherProps.style.paddingTop = '0px'
  // _otherProps.style.paddingBottom = '0px'
  // _otherProps.style.marginRight = '0px'
  // _otherProps.style.marginLeft = '0px'
  // _otherProps.style.marginTop = '0px'
  // _otherProps.style.marginBottom = '0px'
  // _otherProps.style.width = '100%'
  // _otherProps.style.height = '100%'
  // 处理Icon图标
  var Iconfont = function Iconfont(props) {
    var icon = props.icon;
    var antIcon = Icons;
    return /*#__PURE__*/React.createElement(antIcon[icon]);
  };
  // if(btnFlag){
  //     let btnObj = document.getElementById(btnSyle) || document
  // btnObj.onclick = function () {
  //     let elems = (document.getElementById(btnSyle) || document)?.querySelectorAll(
  //         '.ant-btn',
  //     );
  //     elems[0].style.color = btncolor; //高度
  //     elems[0].style.backgroundColor = btnBgcolor; //高度
  //     elems[0].style.borderColor = btnBrcolor; //高度
  // }
  // }
  if (iconFlag) {
    return (
      // <div style={{ width: _otherProps.style.width, height: _otherProps.style.height, display: block ? 'inline-block' : 'none', paddingRight: _otherProps.style.paddingRight, paddingLfet: _otherProps.style.paddingLfet, paddingTop: _otherProps.style.paddingTop, paddingBottom: _otherProps.style.paddingBottom, marginRight: _otherProps.style.marginRight, marginLeft: _otherProps.style.marginLeft, marginTop: _otherProps.style.marginTop, marginBottom: _otherProps.style.marginBottom }}>

      // </div>
      block ? /*#__PURE__*/React.createElement(_Button, _extends({
        className: "btnstyle",
        type: mode,
        size: size,
        disabled: disabled,
        y: true,
        ghost: ghost,
        shape: shape,
        block: block1,
        loading: loading,
        icon: /*#__PURE__*/React.createElement(Iconfont, {
          icon: icon
        }),
        danger: danger,
        href: href
      }, _otherProps), title) : ''
    );
  } else {
    return (
      // <div style={{ width: _otherProps.style.width, height: _otherProps.style.height, display: block ? 'inline-block' : 'none', paddingRight: _otherProps.style.paddingRight, paddingLfet: _otherProps.style.paddingLfet, paddingTop: _otherProps.style.paddingTop, paddingBottom: _otherProps.style.paddingBottom, marginRight: _otherProps.style.marginRight, marginLeft: _otherProps.style.marginLeft, marginTop: _otherProps.style.marginTop, marginBottom: _otherProps.style.marginBottom }}>
      //     <Button

      //         className='btnstyle'
      //         type={mode}
      //         size={size}
      //         disabled={disabled}
      //         ghost={ghost}
      //         shape={shape}
      //         loading={loading}
      //         danger={danger}
      //         href={href}
      //         {..._otherProps}
      //     >{title}</Button>
      // </div>
      block ? /*#__PURE__*/React.createElement(_Button, _extends({
        // className='btnstyle'
        type: mode,
        size: size,
        disabled: disabled,
        ghost: ghost,
        block: block1,
        shape: shape,
        loading: loading,
        danger: danger,
        href: href
      }, _otherProps), title) : ''
    );
  }
};
antButton.displayName = 'antButton';
export default antButton;