export const useLogic = ({ page, onChange, isEndReached, isDisabled, }) => {
    const changeToPreviousPage = () => {
        onChange(page - 1);
    };
    const changePageToNext = () => {
        onChange(page + 1);
    };
    return {
        previousButtonProps: {
            disabled: page === 1 || isDisabled,
            onClick: changeToPreviousPage,
        },
        nextButtonProps: {
            disabled: isEndReached || isDisabled,
            onClick: changePageToNext,
        },
    };
};
