From d270257f2d6115b5a51cfbc497ad4e2435ec5816 Mon Sep 17 00:00:00 2001 From: devjoaov Date: Sat, 27 Apr 2024 12:54:20 -0300 Subject: [PATCH] chore: add items per page as parameter for pagination --- src/components/DataTable/DataTablePagination.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/DataTable/DataTablePagination.tsx b/src/components/DataTable/DataTablePagination.tsx index e4c4972..6352e44 100644 --- a/src/components/DataTable/DataTablePagination.tsx +++ b/src/components/DataTable/DataTablePagination.tsx @@ -9,7 +9,9 @@ import { useTranslation, Trans } from "react-i18next"; import { Button, Select } from "#/components/ui"; import { useTableContext } from "./TableContext"; -export function DataTablePagination() { +export function DataTablePagination({ + itemsPerPageOptions = [10, 20, 30, 40, 50], +}) { // @ts-expect-error TS(2339) FIXME: Property 'table' does not exist on type '{}'. const { table } = useTableContext(); @@ -33,7 +35,7 @@ export function DataTablePagination() { /> - {[10, 20, 30, 40, 50].map((pageSize) => ( + {itemsPerPageOptions.map((pageSize) => ( {pageSize}