import config from "@/config/theme";
import { ADMIN } from "@/config/theme/default";

export default {
  namespaced: true,
  state: {
    isMobile: false,
    animates: ADMIN.animates,
    palettes: ADMIN.palettes,
    ...config,
  },
  mutations: {
    setDevice(state, isMobile) {
      // eslint-disable-next-line
      state.isMobile = isMobile;
    },
    setTheme(state, theme) {
      // eslint-disable-next-line
      state.theme = theme;
    },
    setLayout(state, layout) {
      // eslint-disable-next-line
      state.layout = layout;
    },
    setMultiPage(state, multiPage) {
      // eslint-disable-next-line
      state.multiPage = multiPage;
    },
    setAnimate(state, animate) {
      // eslint-disable-next-line
      state.animate = animate;
    },
    setWeekMode(state, weekMode) {
      // eslint-disable-next-line
      state.weekMode = weekMode;
    },
    setFixedHeader(state, fixedHeader) {
      // eslint-disable-next-line
      state.fixedHeader = fixedHeader;
    },
    setFixedSideBar(state, fixedSideBar) {
      // eslint-disable-next-line
      state.fixedSideBar = fixedSideBar;
    },
    setPageWidth(state, pageWidth) {
      // eslint-disable-next-line
      state.pageWidth = pageWidth;
    },
    setSideMenuWidth(state, sideMenuDefaultWidth) {
      // eslint-disable-next-line
      state.sideMenuDefaultWidth = sideMenuDefaultWidth.toString().includes("px")
        ? sideMenuDefaultWidth
        : `${sideMenuDefaultWidth}px`;
    },
    setFixedTabs(state, fixedTabs) {
      // eslint-disable-next-line
      state.fixedTabs = fixedTabs;
    },
  },
};
