"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useAdminDataTable = void 0;
const react_1 = require("react");
const useAdminDataTable = ({ router, transformer, }) => {
    const [{ pageIndex, pageSize }, onPaginationChange] = (0, react_1.useState)({
        pageIndex: 0,
        pageSize: 10,
    });
    const pagination = (0, react_1.useMemo)(() => ({ pageIndex, pageSize }), [pageIndex, pageSize]);
    const queryResponse = router.get.useQuery({ pageIndex, pageSize });
    return {
        dataTableProps: {
            pagination,
            onPaginationChange,
            queryResponse,
            transformer,
        },
    };
};
exports.useAdminDataTable = useAdminDataTable;
//# sourceMappingURL=use-admin-data-table.js.map