import { PayloadType } from '../constants/type';

export const setCurrentPage = (state: Object, { payload }: PayloadType) => ({
  ...state,
  currentPage: payload,
});

export const setTotalPage = (state: Object, { payload }: PayloadType) => ({
  ...state,
  totalPage: payload,
});

export const setPdf = (state: Object, { payload }: PayloadType) => ({
  ...state,
  pdf: payload,
});

export const setProgress = (state: Object, { payload }: PayloadType) => ({
  ...state,
  progress: payload,
});

export const setViewport = (state: Object, { payload }: PayloadType) => ({
  ...state,
  viewport: payload,
});

export const changeScale = (state: Object, { payload }: PayloadType) => ({
  ...state,
  scale: payload,
});

export const changeRotate = (state: Object, { payload }: PayloadType) => ({
  ...state,
  rotation: payload,
});
