"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = InspectorPopoverHeader;
var _components = require("@wordpress/components");
var _icons = require("@wordpress/icons");
var _i18n = require("@wordpress/i18n");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

function InspectorPopoverHeader({
  title,
  help,
  actions = [],
  onClose
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
    className: "block-editor-inspector-popover-header",
    spacing: 4,
    children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
      alignment: "center",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalHeading, {
        className: "block-editor-inspector-popover-header__heading",
        level: 2,
        size: 13,
        children: title
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalSpacer, {}), actions.map(({
        label,
        icon,
        onClick
      }) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
        className: "block-editor-inspector-popover-header__action",
        label: label,
        icon: icon,
        variant: !icon && 'tertiary',
        onClick: onClick,
        children: !icon && label
      }, label)), onClose && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
        className: "block-editor-inspector-popover-header__action",
        label: (0, _i18n.__)('Close'),
        icon: _icons.closeSmall,
        onClick: onClose
      })]
    }), help && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
      children: help
    })]
  });
}
//# sourceMappingURL=index.js.map