"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = SingleNavigationMenu;
var _i18n = require("@wordpress/i18n");
var _htmlEntities = require("@wordpress/html-entities");
var _sidebarNavigationScreenNavigationMenus = require("../sidebar-navigation-screen-navigation-menus");
var _moreMenu = _interopRequireDefault(require("./more-menu"));
var _navigationMenuEditor = _interopRequireDefault(require("./navigation-menu-editor"));
var _buildNavigationLabel = _interopRequireDefault(require("../sidebar-navigation-screen-navigation-menus/build-navigation-label"));
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

/**
 * Internal dependencies
 */

function SingleNavigationMenu({
  navigationMenu,
  backPath,
  handleDelete,
  handleDuplicate,
  handleSave
}) {
  const menuTitle = navigationMenu?.title?.rendered;
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebarNavigationScreenNavigationMenus.SidebarNavigationScreenWrapper, {
    actions: /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
      children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_moreMenu.default, {
        menuId: navigationMenu?.id,
        menuTitle: (0, _htmlEntities.decodeEntities)(menuTitle),
        onDelete: handleDelete,
        onSave: handleSave,
        onDuplicate: handleDuplicate
      })
    }),
    backPath: backPath,
    title: (0, _buildNavigationLabel.default)(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status),
    description: (0, _i18n.__)('Navigation Menus are a curated collection of blocks that allow visitors to get around your site.'),
    children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_navigationMenuEditor.default, {
      navigationMenuId: navigationMenu?.id
    })
  });
}
//# sourceMappingURL=single-navigation-menu.js.map