import { defineStore, createPinia } from 'pinia';
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';

const { VITE_APP_NAME } = import.meta.env;

export const Store = defineStore({
  id: VITE_APP_NAME,
  state: () => ({}),
  getters: {},
  actions: {},
  persist: {
    key: VITE_APP_NAME,
    storage: window.sessionStorage,
  },
});

const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);

export default pinia;
