/*
 * @Author: your name
 * @Date: 2024-05-27 15:09:27
 * @LastEditTime: 2024-05-27 15:09:54
 * @LastEditors: bogon
 * @Description: In User Settings Edit
 * @FilePath: /performance-test/src/store/themes.js
 */
export default {
  state: {
    theme: localStorage.getItem("theme") || "light",
  },
  mutations: {
    setTheme(state, theme) {
      state.theme = theme;
      localStorage.setItem("theme", theme);
    },
  },
  actions: {
    switchTheme({ commit }, theme) {
      commit("setTheme", theme);
    },
  },
};
