@wordpress/block-library
Version:
Block library for the WordPress editor.
22 lines (21 loc) • 1.11 kB
JavaScript
import { ToggleControl } from "@wordpress/components";
import { __, sprintf } from "@wordpress/i18n";
import { useUnsupportedBlocks } from "../../utils.mjs";
import { Fragment, jsx } from "react/jsx-runtime";
// packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.jsx
function EnhancedPaginationControl({ enhancedPagination, setAttributes, clientId }) {
const unsupportedBlocks = useUnsupportedBlocks(clientId);
let help = __("Reload the full page—instead of just the posts list—when visitors navigate between pages.");
if (unsupportedBlocks.length) help = sprintf(__(`Some blocks aren't supported: %s. Remove them to change this setting.`), unsupportedBlocks.join(__(", ")));
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(ToggleControl, {
label: __("Reload full page"),
help,
checked: !enhancedPagination,
disabled: !!unsupportedBlocks.length,
onChange: (value) => {
setAttributes({ enhancedPagination: !value });
}
}) });
}
export { EnhancedPaginationControl as default };
//# sourceMappingURL=enhanced-pagination-control.mjs.map