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

import classNames from 'classnames';
import { Children } from 'react';
import { isLikeText } from '../Translate';
import { CLS_PREFIX } from '../../constants';
import Heading from '../Heading';
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
/**
 * `PageHeader` component is used for identification of the current page.
 * @since 0.0.35
 */
const PageHeader = _ref => {
  let {
    baseClassName = `${CLS_PREFIX}page-header`,
    className,
    topAddon,
    title,
    titleLeftAddon,
    titleRightAddon,
    breadcrumbs,
    tabs,
    children,
    ...props
  } = _ref;
  return /*#__PURE__*/_jsxs("div", {
    className: classNames(baseClassName, className),
    ...props,
    children: [/*#__PURE__*/_jsxs("div", {
      className: `${baseClassName}__inner`,
      children: [topAddon && /*#__PURE__*/_jsx("div", {
        className: `${baseClassName}__top-addon`,
        children: topAddon
      }), breadcrumbs && /*#__PURE__*/_jsx("div", {
        className: `${baseClassName}__breadcrumbs`,
        children: breadcrumbs
      }), title && /*#__PURE__*/_jsxs("div", {
        className: `${baseClassName}__title`,
        children: [titleLeftAddon && /*#__PURE__*/_jsx("span", {
          className: `${baseClassName}__title-left-addon`,
          children: titleLeftAddon
        }), isLikeText(title) ? /*#__PURE__*/_jsx(Heading, {
          children: title
        }) : title, titleRightAddon && /*#__PURE__*/_jsx("span", {
          className: `${baseClassName}__title-right-addon`,
          children: titleRightAddon
        })]
      }), Children.toArray(children).length ? /*#__PURE__*/_jsx("div", {
        className: `${baseClassName}__content`,
        children: children
      }) : null]
    }), tabs && /*#__PURE__*/_jsx("div", {
      className: `${baseClassName}__tabs`,
      children: /*#__PURE__*/_jsx("div", {
        className: `${baseClassName}__tabs-inner`,
        children: tabs
      })
    })]
  });
};
export default PageHeader;