import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import React from "react";
import { Step, Icon } from "@alicloudfe/components";
import cls from "classnames";

var BDesignStep = function BDesignStep(props) {
  var className = props.className,
      shape = props.shape,
      hasbackground = props.hasbackground,
      size = props.size,
      rest = _objectWithoutProperties(props, ["className", "shape", "hasbackground", "size"]);

  return /*#__PURE__*/React.createElement(Step, _extends({
    className: cls(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 = _objectWithoutProperties(props, ["className", "icon", "shape", "title"]);

  var ItemDemo = /*#__PURE__*/React.createElement(Step.Item, _extends({
    className: cls(className),
    shape: shape,
    title: title,
    icon: icon
  }, rest));

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

  return ItemDemo;
};

BDesignStep.Item = BDesignItem;
export default BDesignStep;