// @ts-check
import { defineStore } from "pinia";

export const useAppStore = defineStore({
  id: "app",
  state: () => ({
    _projectId:
      typeof localStorage.getItem("projectId") === "undefined"
        ? ""
        : localStorage.getItem("projectId"),
  }),
  getters: {
    projectId: (state): string => state._projectId as string,
  },
  actions: {
    async setProjectId(newProjectId: string) {
      localStorage.setItem("projectId", newProjectId);
    },
  },
});
