"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.NavigationBackButtonAsItem = NavigationBackButtonAsItem;
exports.NavigationButtonAsItem = NavigationButtonAsItem;
var _components = require("@wordpress/components");
var _iconWithCurrentColor = require("./icon-with-current-color");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function GenericNavigationButton({
  icon,
  children,
  ...props
}) {
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalItem, {
    ...props,
    children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
      justify: "flex-start",
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_iconWithCurrentColor.IconWithCurrentColor, {
        icon: icon,
        size: 24
      }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.FlexItem, {
        children: children
      })]
    }), !icon && children]
  });
}
function NavigationButtonAsItem(props) {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Navigator.Button, {
    as: GenericNavigationButton,
    ...props
  });
}
function NavigationBackButtonAsItem(props) {
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Navigator.BackButton, {
    as: GenericNavigationButton,
    ...props
  });
}
//# sourceMappingURL=navigation-button.js.map