@wordpress/block-library
Version:
Block library for the WordPress editor.
32 lines (31 loc) • 973 B
JavaScript
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
import { useBlockProps, useInnerBlocksProps } from "@wordpress/block-editor";
import CommentsInspectorControls from "./comments-inspector-controls";
import CommentsLegacy from "./comments-legacy";
import TEMPLATE from "./template";
function CommentsEdit(props) {
const { attributes, setAttributes, clientId } = props;
const { tagName: TagName, legacy } = attributes;
const blockProps = useBlockProps();
const innerBlocksProps = useInnerBlocksProps(blockProps, {
template: TEMPLATE
});
if (legacy) {
return /* @__PURE__ */ jsx(CommentsLegacy, { ...props });
}
return /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(
CommentsInspectorControls,
{
attributes,
setAttributes,
clientId
}
),
/* @__PURE__ */ jsx(TagName, { ...innerBlocksProps })
] });
}
export {
CommentsEdit as default
};
//# sourceMappingURL=index.js.map