"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _classnames = _interopRequireDefault(require("classnames"));
var _react = require("react");
var _Translate = require("../Translate");
var _constants = require("../../constants");
var _Heading = _interopRequireDefault(require("../Heading"));
var _jsxRuntime = require("react/jsx-runtime");
// Copyright 1999-2023. Plesk International GmbH. All rights reserved.

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