import { defineStore } from "pinia";
import { ref } from "vue";
import { load } from "webfontloader";

export const commonStore = defineStore("common", () => {
  const snackbarMsg = ref({ text: "", color: "", result: 200 });

  const setSnackbarMsg = (data: {
    result: number;
    color: string;
    text: string;
  }) => {
    snackbarMsg.value = data;
  };

  return {
    snackbarMsg,
    setSnackbarMsg,
  };
});

export const loadingStore = defineStore("loading", () => {
  const loading = ref(false);
  const setLoading = (value: boolean) => {
    loading.value = value;
  };

  return {
    loading,
    setLoading,
  };
});
