export default function setForumStore() {
  return {
    title: "",
    text: "",
    autoEssayID: undefined as number | undefined,

    lastPage: 0,
    pageUnit: 10,
    viewUnit: 10,
    level: 0,

    setTitle(title: string) {
      this.title = title;
    },

    setText(text: string) {
      this.text = text;
    },

    setAutoEssayID(autoEssayID: number | undefined) {
      this.autoEssayID = autoEssayID;
    },

    setLastPage(lastPage: number) {
      this.lastPage = lastPage;
    },

    setLevel(level: number) {
      this.level = level;
    },

    get isTitleTextFilled() {
      return this.title && this.text;
    },
  };
}
