diff --git a/src/js/components/common/ListTable/TablePagination.tsx b/src/js/components/common/ListTable/TablePagination.tsx index 06b1fd97..cee0f29a 100644 --- a/src/js/components/common/ListTable/TablePagination.tsx +++ b/src/js/components/common/ListTable/TablePagination.tsx @@ -178,6 +178,44 @@ interface PaginationControlsProps { setCurrentPage: (page: number) => void } +type NavigationLinksProps = Omit + +const NavigationLinks: React.FC = ({ + which, + disabled, + totalPages, + inputValue, + currentPage, + useQueryVars, + setCurrentPage, + setInputValue +}) => ( + + + setCurrentPage(inputValue)} + />{'\n'} + + +) + const PaginationControls: React.FC = ({ which, disabled, @@ -188,49 +226,39 @@ const PaginationControls: React.FC = ({ useQueryVars, setCurrentPage, setInputValue -}) => -
{ - event.preventDefault() - setCurrentPage(inputValue) - }} - > - - {/* translators: %s: Number of items. */} - {sprintf(_n('%s item', '%s items', totalItems), totalItems)} - {'\n'} - - - - - setCurrentPage(inputValue)} - />{'\n'} +}) => { + const navLabel = 'top' === which + ? __('Pagination, before the table', 'code-snippets') + : __('Pagination, after the table', 'code-snippets') - - -
+ return ( + + ) +} export interface TablePaginationProps extends Omit, Required> {