import React from 'react';
import PropTypes from 'prop-types';

var CurrentItem = function CurrentItem(_ref) {
  var currentPage = _ref.currentPage;
  return React.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 React.createElement(
    'li',
    { className: 'ma__breadcrumb-item' },
    currentPage ? React.createElement(CurrentItem, { currentPage: currentPage }) : children
  );
};

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

export default BreadcrumbItem;