Files
portabase/src/components/wrappers/table/table-pagination.tsx
T

25 lines
815 B
TypeScript
Raw Normal View History

2024-11-11 14:56:33 +01:00
"use client"
import {TablePaginationNavigation} from "@/components/wrappers/table/table-pagination-navigation";
import {TablePaginationSize} from "@/components/wrappers/table/table-pagination-size";
import {cn} from "@/lib/utils";
interface tablePaginationProps {
className?: string
table: any
maxVisiblePages?: number
2024-11-11 19:12:34 +01:00
pageSizeOptions?: number[]
2024-11-11 14:56:33 +01:00
}
export function TablePagination(props: tablePaginationProps) {
2024-11-11 19:12:34 +01:00
const {className, table, maxVisiblePages = 3, pageSizeOptions = [10, 20, 30, 40, 50]} = props
2024-11-11 14:56:33 +01:00
return (
2024-11-11 19:12:34 +01:00
<div className={cn("flex mt-6", className)}>
<TablePaginationSize table={table} pageSizeOptions={pageSizeOptions}/>
<TablePaginationNavigation table={table} maxVisiblePages={maxVisiblePages} className="justify-end"/>
2024-11-11 14:56:33 +01:00
</div>
)
}