import _extends from "@babel/runtime-corejs3/helpers/extends";
import _defineProperty from "@babel/runtime-corejs3/helpers/defineProperty";
import _classCallCheck from "@babel/runtime-corejs3/helpers/classCallCheck";
import _createClass from "@babel/runtime-corejs3/helpers/createClass";
import _inherits from "@babel/runtime-corejs3/helpers/inherits";
import _createSuper from "@babel/runtime-corejs3/helpers/createSuper";
import * as React from 'react';
import RcSteps from 'rc-steps';
import CheckOutlined from "mk-icon/es/icons/CheckOutlined";
import CloseOutlined from "mk-icon/es/icons/CloseOutlined";
import classNames from 'classnames';
import { ConfigConsumer } from '../config-provider';

var Steps = /*#__PURE__*/function (_React$Component) {
  _inherits(Steps, _React$Component);

  var _super = _createSuper(Steps);

  function Steps() {
    var _this;

    _classCallCheck(this, Steps);

    _this = _super.apply(this, arguments);

    _this.renderSteps = function (_ref) {
      var getPrefixCls = _ref.getPrefixCls,
          direction = _ref.direction;
      var prefixCls = getPrefixCls('steps', _this.props.prefixCls);
      var iconPrefix = getPrefixCls('', _this.props.iconPrefix);
      var className = classNames(_this.props.className, _defineProperty({}, "".concat(prefixCls, "-rtl"), direction === 'rtl'));
      var icons = {
        finish: /*#__PURE__*/React.createElement(CheckOutlined, {
          className: "".concat(prefixCls, "-finish-icon")
        }),
        error: /*#__PURE__*/React.createElement(CloseOutlined, {
          className: "".concat(prefixCls, "-error-icon")
        })
      };
      return /*#__PURE__*/React.createElement(RcSteps, _extends({
        icons: icons
      }, _this.props, {
        prefixCls: prefixCls,
        iconPrefix: iconPrefix,
        className: className
      }));
    };

    return _this;
  }

  _createClass(Steps, [{
    key: "render",
    value: function render() {
      return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderSteps);
    }
  }]);

  return Steps;
}(React.Component);

export { Steps as default };
Steps.Step = RcSteps.Step;
Steps.defaultProps = {
  current: 0
};