import _Breadcrumb from "@alifd/next/es/breadcrumb";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["dataList", "itemList"];
import React from 'react';
import "./index.scss";
var BreadCrumb = function BreadCrumb(_ref) {
  var dataList = _ref.dataList,
    itemList = _ref.itemList,
    otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
  var _otherProps = otherProps || {};
  var renderItems = function renderItems() {
    if ((dataList === null || dataList === void 0 ? void 0 : dataList.length) > 0) {
      return dataList.map(function (item, index) {
        return /*#__PURE__*/React.createElement(_Breadcrumb.Item, {
          key: index,
          link: item.link
        }, item.name);
      });
    }
    if ((itemList === null || itemList === void 0 ? void 0 : itemList.length) > 0) {
      return itemList.map(function (item, index) {
        return /*#__PURE__*/React.createElement(_Breadcrumb.Item, {
          key: index,
          link: item.link
        }, item.name);
      });
    }
    return /*#__PURE__*/React.createElement(_Breadcrumb.Item, null, "\u6682\u65E0\u6570\u636E");
  };
  return /*#__PURE__*/React.createElement(_Breadcrumb, _otherProps, renderItems());
};
BreadCrumb.displayName = 'BreadCrumb';
export default BreadCrumb;