"use strict";

var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _utils = require("../../utils");

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

var _classnames = _interopRequireDefault(require("classnames"));

var _constants = require("../../constants");

var _Icon = _interopRequireDefault(require("../Icon"));

// Copyright 1999-2020. Plesk International GmbH. All rights reserved.

/**
 * `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(_constants.CLS_PREFIX, "breadcrumbs"),
  className,
  children,
  ...props
}) => /*#__PURE__*/_react.default.createElement("nav", (0, _extends2.default)({
  role: "navigation",
  "aria-label": "Breadcrumbs",
  className: (0, _classnames.default)(baseClassName, className)
}, props), /*#__PURE__*/_react.default.createElement("ul", {
  className: "".concat(baseClassName, "__list")
}, _react.Children.map(children, child => /*#__PURE__*/_react.default.createElement("li", {
  className: "".concat(baseClassName, "__item")
}, child, /*#__PURE__*/_react.default.createElement("span", {
  className: "".concat(baseClassName, "__separator")
}, /*#__PURE__*/_react.default.createElement(_Icon.default, {
  name: (0, _utils.isRtl)() ? 'chevron-left' : 'chevron-right'
}))))));

var _default = Breadcrumbs;
exports.default = _default;