UNPKG

@wordpress/block-library

Version:
33 lines (32 loc) • 1.38 kB
import { __experimentalHStack, __experimentalHeading } from "@wordpress/components"; import { __ } from "@wordpress/i18n"; import { privateApis } from "@wordpress/block-editor"; import NavigationMenuSelector from "./navigation-menu-selector.mjs"; import { unlock } from "../../lock-unlock.mjs"; import { jsx, jsxs } from "react/jsx-runtime"; // packages/block-library/src/navigation/edit/navigation-list-view-header.jsx const { useBlockDisplayTitle } = unlock(privateApis); const actionLabel = __("Switch to '%s'"); function NavigationListViewHeader({ clientId, blockEditingMode, currentMenuId, onSelectClassicMenu, onSelectNavigationMenu, onCreateNew, isManageMenusButtonDisabled }) { const blockTitle = useBlockDisplayTitle({ clientId, context: "list-view" }); return /* @__PURE__ */ jsxs(__experimentalHStack, { className: "wp-block-navigation-off-canvas-editor__header", children: [/* @__PURE__ */ jsx(__experimentalHeading, { className: "wp-block-navigation-off-canvas-editor__title", level: 2, children: blockTitle }), blockEditingMode === "default" && /* @__PURE__ */ jsx(NavigationMenuSelector, { currentMenuId, onSelectClassicMenu, onSelectNavigationMenu, onCreateNew, actionLabel, isManageMenusButtonDisabled })] }); } export { NavigationListViewHeader as default }; //# sourceMappingURL=navigation-list-view-header.mjs.map