import classnames from "classnames"; import React, { PropsWithChildren } from "react"; import { Select } from "../select/select.component"; import { getPageNumbers, LEFT_PAGE, RIGHT_PAGE } from "../table/utils/getPageNumbers"; function PaginationButton( props: PropsWithChildren< { component?: any; disabled?: boolean; className?: string; active?: boolean; } & Record > ) { const { component: Component = "button", children, disabled, active, ...otherProps } = props; return ( {children} ); } export interface PaginationProps { className?: string; pageSizes?: number[]; gotoPage: any; canPreviousPage: boolean; previousPage: any; nextPage: any; canNextPage: boolean; pageCount: number; pageIndex: number; pageOptions?: any; pageSize: number; setPageSize: any; i18n?: (f: string) => string; } export function Pagination(props: PaginationProps) { const { className, pageSizes = [10, 25, 50, 100], gotoPage, canPreviousPage, previousPage, nextPage, canNextPage, pageCount, pageIndex, pageOptions, pageSize, setPageSize, i18n = (f: string) => f } = props; const pageNumbers = getPageNumbers({ currentPage: pageIndex, // pageNeighbours, totalPages: pageCount }); const choices: any[] = pageSizes.map((value) => ({ value, label: value })); return (