import { defineStore } from "pinia";
import { ref } from "vue";
import type { GameDataValue } from "#layers/types/api/gameData";

export const useGameDataStore = defineStore("gameData", () => {
  const gameData = ref<GameDataValue | null>(null);

  const setGameData = (data: GameDataValue) => {
    gameData.value = data;
  };

  const clearGameData = () => {
    gameData.value = null;
  };

  return {
    gameData,
    setGameData,
    clearGameData,
  };
});
