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

export const usePageDataStore = defineStore("pageData", () => {
  const pageData = ref<PageDataValue | null>(null);

  const setPageData = (response: PageDataValue) => {
    pageData.value = response;
  };

  const clearPageData = () => {
    pageData.value = null;
  };

  return {
    pageData,
    setPageData,
    clearPageData,
  };
});
