'use strict';

exports.__esModule = true;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

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

var CurrentItem = function CurrentItem(_ref) {
  var currentPage = _ref.currentPage;
  return _react2.default.createElement(
    'a',
    { href: '/', 'aria-current': 'page', onClick: function onClick(e) {
        return e.preventDefault();
      } },
    currentPage
  );
};

var BreadcrumbItem = function BreadcrumbItem(props) {
  // eslint-disable-next-line react/prop-types
  var children = props.children,
      currentPage = props.currentPage;

  return _react2.default.createElement(
    'li',
    { className: 'ma__breadcrumb-item' },
    currentPage ? _react2.default.createElement(CurrentItem, { currentPage: currentPage }) : children
  );
};

CurrentItem.propTypes = process.env.NODE_ENV !== "production" ? {
  /** Current page name, rendered as the last breadcrumb item */
  currentPage: _propTypes2.default.string
} : {};

exports.default = BreadcrumbItem;
module.exports = exports['default'];