"use strict";

exports.__esModule = true;
exports.default = void 0;

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

var _propTypes = _interopRequireDefault(require("prop-types"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

/**
 * @category navigation
 * @component breadcrumbs
 * @variations collab-ui-react
 */
var Breadcrumbs =
/*#__PURE__*/
function (_React$PureComponent) {
  _inheritsLoose(Breadcrumbs, _React$PureComponent);

  function Breadcrumbs() {
    return _React$PureComponent.apply(this, arguments) || this;
  }

  var _proto = Breadcrumbs.prototype;

  _proto.render = function render() {
    var _this$props = this.props,
        className = _this$props.className,
        children = _this$props.children;

    var items = _react.default.Children.map(children, function (child, idx) {
      if (children.length - 1 === idx || !children.length) {
        return _react.default.cloneElement(child, {
          className: 'current'
        });
      }

      return child;
    });

    return _react.default.createElement("ul", {
      className: 'cui-breadcrumbs' + (" " + className)
    }, items);
  };

  return Breadcrumbs;
}(_react.default.PureComponent);

Breadcrumbs.displayName = 'Breadcrumbs';
Breadcrumbs.propTypes = {
  children: _propTypes.default.node,
  className: _propTypes.default.string
};
Breadcrumbs.defaultProps = {
  children: null,
  className: ''
};
var _default = Breadcrumbs;
/**
* @name Default Breadcrumbs
* @description Badges are useful.
*
* @category navigation
* @component breadcrumbs
* @section default
*
* @js

import { ListItem } from '@collab-ui/react';

export default function Default() {
    return (
      <div className='row'>
        <div className='columns small-12'>
          <Breadcrumbs>
            <li href='javascript:void(0)'>
              Default
            </li>
          </Breadcrumbs>
        </div>
        <div className='columns small-12'>
          <Breadcrumbs>
            <li href='javascript:void(0)'>
              Default
            </li>
            <li href='javascript:void(0)'>
              Default2
            </li>
          </Breadcrumbs>
        </div>
        <div className='columns small-12'>
          <Breadcrumbs>
            <li href='javascript:void(0)'>
              Default
            </li>
            <li href='javascript:void(0)'>
              Default2
            </li>
            <li href='javascript:void(0)'>
              Default3
            </li>
          </Breadcrumbs>
        </div>
      </div>
    );
  }

**/

exports.default = _default;