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

/**
 * `PageHeader` component is used for identification of the current page.
 * @since 0.0.35
 */
const PageHeader = ({
  baseClassName = "".concat(CLS_PREFIX, "page-header"),
  className,
  topAddon,
  title,
  titleLeftAddon,
  titleRightAddon,
  breadcrumbs,
  tabs,
  children,
  ...props
}) => /*#__PURE__*/React.createElement("div", _extends({
  className: classNames(baseClassName, className)
}, props), /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "__inner")
}, topAddon && /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "__top-addon")
}, topAddon), breadcrumbs && /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "__breadcrumbs")
}, breadcrumbs), title && /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "__title")
}, titleLeftAddon && /*#__PURE__*/React.createElement("span", {
  className: "".concat(baseClassName, "__title-left-addon")
}, titleLeftAddon), isLikeText(title) ? /*#__PURE__*/React.createElement(Heading, null, title) : title, titleRightAddon && /*#__PURE__*/React.createElement("span", {
  className: "".concat(baseClassName, "__title-right-addon")
}, titleRightAddon)), Children.toArray(children).length ? /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "__content")
}, children) : null), tabs && /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "__tabs")
}, /*#__PURE__*/React.createElement("div", {
  className: "".concat(baseClassName, "__tabs-inner")
}, tabs)));

export default PageHeader;