import { GetterTree, mapGetters, mapMutations, MutationTree } from 'vuex';

interface State {
  page: number;
}

export const state = {
  page: 1,
};

export const getters: GetterTree<State, State> = {
  page(state) {
    return state.page;
  },
};

export const mutations: MutationTree<State> = {
  setPage(state, page) {
    state.page = page;
  },
};

export const baseTableComputed = {
  ...mapGetters('commonComponents/baseTable', ['page']),
};

export const baseTableMutations = mapMutations('commonComponents/baseTable', [
  'setPage',
]);
