UNPKG

@wordpress/block-library

Version:
40 lines (39 loc) 1.21 kB
// packages/block-library/src/query/edit/inspector-controls/enhanced-pagination-control.js import { ToggleControl } from "@wordpress/components"; import { __ } from "@wordpress/i18n"; import { useUnsupportedBlocks } from "../../utils"; import { Fragment, jsx } from "react/jsx-runtime"; function EnhancedPaginationControl({ enhancedPagination, setAttributes, clientId }) { const hasUnsupportedBlocks = useUnsupportedBlocks(clientId); let help = __( "Reload the full page\u2014instead of just the posts list\u2014when visitors navigate between pages." ); if (hasUnsupportedBlocks) { help = __( "Enhancement disabled because there are non-compatible blocks inside the Query block." ); } return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx( ToggleControl, { __nextHasNoMarginBottom: true, label: __("Reload full page"), help, checked: !enhancedPagination, disabled: hasUnsupportedBlocks, onChange: (value) => { setAttributes({ enhancedPagination: !value }); } } ) }); } export { EnhancedPaginationControl as default }; //# sourceMappingURL=enhanced-pagination-control.js.map