// packages/block-editor/src/components/block-settings-menu-controls/edit-section-menu-item.js
import { MenuItem } from "@wordpress/components";
import { _x } from "@wordpress/i18n";
import useContentOnlySectionEdit from "../../hooks/use-content-only-section-edit";
import { jsx } from "react/jsx-runtime";
function EditSectionMenuItem({ clientId, onClose }) {
  const {
    isSectionBlock,
    isEditingContentOnlySection,
    editContentOnlySection
  } = useContentOnlySectionEdit(clientId);
  if (!window?.__experimentalContentOnlyPatternInsertion || !isSectionBlock || isEditingContentOnlySection) {
    return null;
  }
  return /* @__PURE__ */ jsx(
    MenuItem,
    {
      onClick: () => {
        editContentOnlySection(clientId);
        onClose();
      },
      children: _x("Edit section", "Editing a section in the Editor")
    }
  );
}
export {
  EditSectionMenuItem
};
//# sourceMappingURL=edit-section-menu-item.js.map
