Skip to content

Commit

Permalink
chore: add items per page as parameter for pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
devjoaov committed Apr 27, 2024
1 parent 39ee4d9 commit d270257
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/DataTable/DataTablePagination.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -33,7 +35,7 @@ export function DataTablePagination() {
/>
</Select.SelectTrigger>
<Select.SelectContent side="top">
{[10, 20, 30, 40, 50].map((pageSize) => (
{itemsPerPageOptions.map((pageSize) => (
<Select.SelectItem key={pageSize} value={`${pageSize}`}>
{pageSize}
</Select.SelectItem>
Expand Down

0 comments on commit d270257

Please sign in to comment.