// packages/block-editor/src/components/block-inspector/edit-contents.js
import { Button, __experimentalVStack as VStack } from "@wordpress/components";
import { __ } from "@wordpress/i18n";
import useContentOnlySectionEdit from "../../hooks/use-content-only-section-edit";
import { jsx } from "react/jsx-runtime";
function EditContents({ clientId }) {
  const {
    isWithinSection,
    isWithinEditedSection,
    editedContentOnlySection,
    editContentOnlySection,
    stopEditingContentOnlySection
  } = useContentOnlySectionEdit(clientId);
  if (!isWithinSection && !isWithinEditedSection) {
    return null;
  }
  return /* @__PURE__ */ jsx(VStack, { className: "block-editor-block-inspector-edit-contents", expanded: true, children: /* @__PURE__ */ jsx(
    Button,
    {
      className: "block-editor-block-inspector-edit-contents__button",
      __next40pxDefaultSize: true,
      variant: "secondary",
      onClick: () => {
        if (!editedContentOnlySection) {
          editContentOnlySection(clientId);
        } else {
          stopEditingContentOnlySection();
        }
      },
      children: editedContentOnlySection ? __("Exit section") : __("Edit section")
    }
  ) });
}
export {
  EditContents as default
};
//# sourceMappingURL=edit-contents.js.map
