"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataGridPagination = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const DataGridPaginationContainer_1 = require("../DataGridPaginationContainer");
const Pagination_1 = require("../Pagination");
const useLogic_1 = require("./useLogic");
const DataGridPagination = (props) => {
    const { isVisiblePagination, pageCount, formattedRange, actualTotalCount } = (0, useLogic_1.useLogic)(props);
    const { page, totalCount, className, rowsPerPage, rowsPerPageOptions, isForceCounter, disabled, onSetCountPerPage, ...restProps } = props;
    if ((!isVisiblePagination && !isForceCounter) || !actualTotalCount) {
        return null;
    }
    return ((0, jsx_runtime_1.jsx)(DataGridPaginationContainer_1.DataGridPaginationContainer, { rowsPerPage: rowsPerPage, rowsPerPageOptions: rowsPerPageOptions, isDisabled: disabled, formattedRange: formattedRange, className: className, onSetCountPerPage: onSetCountPerPage, pagination: isVisiblePagination && ((0, jsx_runtime_1.jsx)(Pagination_1.Pagination, { disabled: disabled, count: pageCount, page: page, ...restProps })) }));
};
exports.DataGridPagination = DataGridPagination;
