import { defineStore } from "pinia";
import { store } from "@/store";

export const useManageProjectStore = defineStore({
  id: "pure-manage-project",
  state: () => ({
    currentArchiveId: localStorage.getItem(`CACHE_CURRENTARCHIVES_ID`)
  }),
  getters: {
    getCurrentArchives(state) {
      return state.currentArchiveId;
    }
  },
  actions: {
    SET_CURRENT_ARCHIVES(ID: string) {
      localStorage.setItem(`CACHE_CURRENTARCHIVES_ID`, ID);
      this.currentArchiveId = ID;
    }
  }
});

export function useManageProjectStoreHook() {
  return useManageProjectStore(store);
}
