2022-11-22 12:16:34 +00:00
|
|
|
import { PaginationControls } from '@@/PaginationControls';
|
|
|
|
|
|
|
|
import { Table } from './Table';
|
|
|
|
import { SelectedRowsCount } from './SelectedRowsCount';
|
|
|
|
|
|
|
|
interface Props {
|
|
|
|
totalSelected: number;
|
|
|
|
pageSize: number;
|
|
|
|
page: number;
|
|
|
|
onPageChange(page: number): void;
|
2023-08-22 06:36:31 +00:00
|
|
|
pageCount: number;
|
2022-11-22 12:16:34 +00:00
|
|
|
onPageSizeChange(pageSize: number): void;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function DatatableFooter({
|
|
|
|
totalSelected,
|
|
|
|
pageSize,
|
|
|
|
page,
|
|
|
|
onPageChange,
|
2023-08-22 06:36:31 +00:00
|
|
|
pageCount,
|
2022-11-22 12:16:34 +00:00
|
|
|
onPageSizeChange,
|
|
|
|
}: Props) {
|
|
|
|
return (
|
|
|
|
<Table.Footer>
|
|
|
|
<SelectedRowsCount value={totalSelected} />
|
|
|
|
<PaginationControls
|
|
|
|
showAll
|
|
|
|
pageLimit={pageSize}
|
|
|
|
page={page + 1}
|
|
|
|
onPageChange={(page) => onPageChange(page - 1)}
|
2023-08-22 06:36:31 +00:00
|
|
|
pageCount={pageCount}
|
2022-11-22 12:16:34 +00:00
|
|
|
onPageLimitChange={onPageSizeChange}
|
|
|
|
/>
|
|
|
|
</Table.Footer>
|
|
|
|
);
|
|
|
|
}
|