Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

772 B
Raw Blame
import { PaginationControls } from "metabase/common/components/PaginationControls";
import { PAGE_SIZE } from "metabase/monitor/constants";
import { Flex } from "metabase/ui";

type DiagnosticsPaginationProps = {
  page: number;
  pageItemCount: number;
  totalCount: number;
  onPageChange: (page: number) => void;
};

export function DiagnosticsPagination({
  page,
  pageItemCount,
  totalCount,
  onPageChange,
}: DiagnosticsPaginationProps) {
  return (
    <Flex justify="end">
      <PaginationControls
        page={page}
        pageSize={PAGE_SIZE}
        itemsLength={pageItemCount}
        total={totalCount}
        showTotal
        onPreviousPage={() => onPageChange(page - 1)}
        onNextPage={() => onPageChange(page + 1)}
      />
    </Flex>
  );
}