import { useCallback } from "react";
import { gridPagingReducer } from "./gridPagingReducer.js";
import { useSessionStorageState } from "@contember/react-utils";
const useGridPagingState = (itemsPerPage, dataGridKey) => {
  const [paginatorState, setPaginatorState] = useSessionStorageState(`${dataGridKey}-page`, (val) => val ?? {
    pageIndex: 0,
    itemsPerPage
  });
  return [
    paginatorState,
    useCallback((action) => {
      setPaginatorState((val) => gridPagingReducer(val, action));
    }, [setPaginatorState])
  ];
};
export { useGridPagingState };
//# sourceMappingURL=useGridPagingState.js.map
