"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _utils = require("../../utils");
var _react = require("react");
var _classnames = _interopRequireDefault(require("classnames"));
var _constants = require("../../constants");
var _Icon = _interopRequireDefault(require("../Icon"));
var _jsxRuntime = require("react/jsx-runtime");
// Copyright 1999-2023. 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 = _ref => {
  let {
    baseClassName = `${_constants.CLS_PREFIX}breadcrumbs`,
    className,
    children,
    ...props
  } = _ref;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
    role: "navigation",
    "aria-label": "Breadcrumbs",
    className: (0, _classnames.default)(baseClassName, className),
    ...props,
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)("ul", {
      className: `${baseClassName}__list`,
      children: _react.Children.map(children, child => /*#__PURE__*/(0, _jsxRuntime.jsxs)("li", {
        className: `${baseClassName}__item`,
        children: [child, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
          className: `${baseClassName}__separator`,
          children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.default, {
            name: (0, _utils.isRtl)() ? 'chevron-left' : 'chevron-right'
          })
        })]
      }))
    })
  });
};
var _default = exports.default = Breadcrumbs;