function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import React from 'react';
import Link from '../link/Link';
import Text from "../text/Text";
import style from "./BreadCrumbs.module.css";
import compileClassNames from "../../libraries/compileClassNames";
export default function (props) {
  let {
    text,
    children,
    href,
    onClick,
    active,
    dataId,
    ariaLabel,
    role,
    ariaCurrent,
    customClassName,
    isEllipsis,
    size,
    tagAttributeProps
  } = props;
  let classes = compileClassNames(customClassName, {
    [style.flex]: true
  });
  let contentClassName = compileClassNames(customClassName, {
    [style.content]: true
  }, {
    [customClassName.content]: !!customClassName.content
  });
  return /*#__PURE__*/React.createElement("li", _extends({
    "aria-label": ariaLabel,
    "aria-current": ariaCurrent,
    role: role,
    className: classes
  }, tagAttributeProps), href && !active ? /*#__PURE__*/React.createElement("span", {
    className: contentClassName
  }, /*#__PURE__*/React.createElement(Link, {
    text: text,
    href: href,
    onClick: onClick,
    customIdPrefix: dataId,
    size: size,
    active: active,
    textEllipsis: isEllipsis
  })) : typeof children == "string" || text ? /*#__PURE__*/React.createElement("span", {
    className: contentClassName
  }, /*#__PURE__*/React.createElement(Text, {
    onClick: onClick,
    customIdPrefix: dataId,
    content: children ? children : text,
    size: size,
    isEllipsis: isEllipsis
  })) : children);
}