import { useCallback, useMemo } from "react";
export const usePagination = ({ page, setPage, pageCount }) => {
    const noPages = useMemo(() => {
        return pageCount === 0;
    }, [pageCount]);
    const isFirstPage = useMemo(() => {
        return page === 1;
    }, [page]);
    const isLastPage = useMemo(() => {
        return page === pageCount;
    }, [page, pageCount]);
    const goToPage = useCallback((page) => {
        setPage(page);
    }, [setPage]);
    return {
        goToPage,
        isFirstPage,
        isLastPage,
        noPages,
    };
};
//# sourceMappingURL=use-pagination.js.map