diff --git a/packages/dataviews/src/pagination.js b/packages/dataviews/src/pagination.js index f69d7c7a12e19..1232303bc932e 100644 --- a/packages/dataviews/src/pagination.js +++ b/packages/dataviews/src/pagination.js @@ -6,8 +6,8 @@ import { __experimentalHStack as HStack, SelectControl, } from '@wordpress/components'; -import { createInterpolateElement, memo } from '@wordpress/element'; -import { sprintf, __, _x } from '@wordpress/i18n'; +import { memo } from '@wordpress/element'; +import { sprintf, __ } from '@wordpress/i18n'; import { chevronRight, chevronLeft } from '@wordpress/icons'; const Pagination = memo( function Pagination( { @@ -27,36 +27,34 @@ const Pagination = memo( function Pagination( { justify="end" className="dataviews-pagination" > - - { createInterpolateElement( - sprintf( + + { + const page = i + 1; + return { value: page, label: page }; + } + ) } + onChange={ ( newValue ) => { + onChangeView( { + ...view, + page: +newValue, + } ); + } } + size="compact" + __nextHasNoMarginBottom + hideLabelFromVision + /> + + { sprintf( // translators: %s: Total number of pages. - _x( 'Page of %s', 'paging' ), + 'of %s', totalPages - ), - { - CurrenPageControl: ( - { - const page = i + 1; - return { value: page, label: page }; - } ) } - onChange={ ( newValue ) => { - onChangeView( { - ...view, - page: +newValue, - } ); - } } - size={ 'compact' } - __nextHasNoMarginBottom - /> - ), - } - ) } + ) } +