"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 _classnames = _interopRequireDefault(require("classnames"));

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

var _Translate = require("../Translate");

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

var _Heading = _interopRequireDefault(require("../Heading"));

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

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

var _default = PageHeader;
exports.default = _default;