import { create } from "zustand";

interface ModelState {
  objectToEdit: any;
  setObjectToEdit: (data: any) => void;
  paramToSend: any;
  setParamToSend: (data: any) => void;
  TagsSearch: any;
  setTagsSearch: (data: any) => void;
  TagsQuery: any;
  setTagsQuery: (data: any) => void;
  currentTag: any;
  setCurrentTag: (data: any) => void;
  currentParentIndex: any;
  setCurrentParentIndex: (data: any) => void;
  isBseQuestion: boolean;
  setIsBseQuestion: (data: any) => void;
  Success: boolean;
  setSuccess: (data: any) => void;
  DeletedQuestions: any;
  setDeletedQuestions: (data: any) => void;

  SavedQuestionData: any;
  setSavedQuestionData: (data: any) => void;
}

export const useObjectToEdit = create<ModelState>((set) => ({
  objectToEdit: null,
  setObjectToEdit: (data) => set(() => ({ objectToEdit: data })),
  paramToSend: {},
  setParamToSend: (data) => set(() => ({ paramToSend: data })),
  TagsSearch: null,
  setTagsSearch: (data) => set(() => ({ TagsSearch: data })),
  TagsQuery: null,
  setTagsQuery: (data) => set(() => ({ TagsQuery: data })),
  currentTag: null,
  setCurrentTag: (data) => set(() => ({ currentTag: data })),
  currentParentIndex: null,
  setCurrentParentIndex: (data) => set(() => ({ currentParentIndex: data })),
  isBseQuestion: false,
  setIsBseQuestion: (data) => set(() => ({ isBseQuestion: data })),
  Success: false,
  setSuccess: (data) => set(() => ({ Success: data })),
  DeletedQuestions: [],
  setDeletedQuestions: (data) => set(() => ({ DeletedQuestions: data })),
  SavedQuestionData: [],
  setSavedQuestionData: (data) => set(() => ({ SavedQuestionData: data })),
}));
