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

import { isRtl } from '../../utils';
import { Children } from 'react';
import classNames from 'classnames';
import { CLS_PREFIX } from '../../constants';
import Icon from '../Icon';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
/**
 * `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 = `${CLS_PREFIX}breadcrumbs`,
    className,
    children,
    ...props
  } = _ref;
  return /*#__PURE__*/_jsx("nav", {
    role: "navigation",
    "aria-label": "Breadcrumbs",
    className: classNames(baseClassName, className),
    ...props,
    children: /*#__PURE__*/_jsx("ul", {
      className: `${baseClassName}__list`,
      children: Children.map(children, child => /*#__PURE__*/_jsxs("li", {
        className: `${baseClassName}__item`,
        children: [child, /*#__PURE__*/_jsx("span", {
          className: `${baseClassName}__separator`,
          children: /*#__PURE__*/_jsx(Icon, {
            name: isRtl() ? 'chevron-left' : 'chevron-right'
          })
        })]
      }))
    })
  });
};
export default Breadcrumbs;