import _extends from "@babel/runtime/helpers/extends";
// Copyright 1999-2020. Plesk International GmbH. All rights reserved.
import { isRtl } from '../../utils';
import React, { Children } from 'react';
import classNames from 'classnames';
import { CLS_PREFIX } from '../../constants';
import Icon from '../Icon';

/**
 * `Breadcrumbs` component indicates a position of current page in general hierarchy of all pages,
 * and it is used for navigation up to the main page of the product.
 * @since 2.3.0
 */
const Breadcrumbs = ({
  baseClassName = "".concat(CLS_PREFIX, "breadcrumbs"),
  className,
  children,
  ...props
}) => /*#__PURE__*/React.createElement("nav", _extends({
  role: "navigation",
  "aria-label": "Breadcrumbs",
  className: classNames(baseClassName, className)
}, props), /*#__PURE__*/React.createElement("ul", {
  className: "".concat(baseClassName, "__list")
}, Children.map(children, child => /*#__PURE__*/React.createElement("li", {
  className: "".concat(baseClassName, "__item")
}, child, /*#__PURE__*/React.createElement("span", {
  className: "".concat(baseClassName, "__separator")
}, /*#__PURE__*/React.createElement(Icon, {
  name: isRtl() ? 'chevron-left' : 'chevron-right'
}))))));

export default Breadcrumbs;