"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _components = require("@alicloudfe/components");

var _classnames = _interopRequireDefault(require("classnames"));

var BDesignStep = function BDesignStep(props) {
  var className = props.className,
      shape = props.shape,
      hasbackground = props.hasbackground,
      size = props.size,
      rest = (0, _objectWithoutProperties2.default)(props, ["className", "shape", "hasbackground", "size"]);
  return /*#__PURE__*/_react.default.createElement(_components.Step, (0, _extends2.default)({
    className: (0, _classnames.default)(className, {
      'next-step-line': shape === "line",
      'next-step-arrownobg': hasbackground === false,
      'next-step-small': size === 'small'
    }),
    shape: shape
  }, rest));
};

var BDesignItem = function BDesignItem(props) {
  var className = props.className,
      icon = props.icon,
      shape = props.shape,
      title = props.title,
      rest = (0, _objectWithoutProperties2.default)(props, ["className", "icon", "shape", "title"]);

  var ItemDemo = /*#__PURE__*/_react.default.createElement(_components.Step.Item, (0, _extends2.default)({
    className: (0, _classnames.default)(className),
    shape: shape,
    title: title,
    icon: icon
  }, rest));

  if (shape === 'arrow') {
    ItemDemo = /*#__PURE__*/_react.default.createElement(_components.Step.Item, (0, _extends2.default)({
      className: (0, _classnames.default)(className)
    }, rest, {
      itemRender: function itemRender() {
        return /*#__PURE__*/_react.default.createElement("div", {
          className: "next-step-item-title"
        }, /*#__PURE__*/_react.default.createElement(_components.Icon, {
          type: "success-filling",
          size: "small"
        }), /*#__PURE__*/_react.default.createElement("span", null, title));
      }
    }));
  }

  return ItemDemo;
};

BDesignStep.Item = BDesignItem;
var _default = BDesignStep;
exports.default = _default;