"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TablePagination = void 0;
const tslib_1 = require("tslib");
const components_1 = require("@bluebase/components");
const TablePagination_1 = tslib_1.__importDefault(require("@material-ui/core/TablePagination"));
const lodash_get_1 = tslib_1.__importDefault(require("lodash.get"));
const react_1 = tslib_1.__importDefault(require("react"));
const helpers_1 = require("../../helpers");
exports.TablePagination = (props) => {
    const { count, onPageChange, page, rowsPerPage, rowsPerPageOptions, style, onChangeRowsPerPage: _onChangeRowsPerPage } = props, rest = tslib_1.__rest(props, ["count", "onPageChange", "page", "rowsPerPage", "rowsPerPageOptions", "style", "onChangeRowsPerPage"]);
    const onChangeRowsPerPage = lodash_get_1.default(props, 'onChangeRowsPerPage', helpers_1.noop);
    const onChangePage = (_event, pageNum) => onPageChange(pageNum);
    const onChangeRowsPerPageCustom = (event) => {
        onChangeRowsPerPage(event.target.value);
    };
    return (react_1.default.createElement(TablePagination_1.default, Object.assign({ count: count, 
        // onChangePage={onChangePage}
        onPageChange: onChangePage, page: page, rowsPerPage: rowsPerPage, rowsPerPageOptions: rowsPerPageOptions, onChangeRowsPerPage: onChangeRowsPerPageCustom, style: style }, rest)));
};
exports.TablePagination.defaultProps = components_1.TablePaginationDefaultProps;
