import { defineStore } from 'pinia';

// Define the type for the state
interface ModalState {
  isOpen: boolean;
}

export const useModalStore = defineStore('modal', {
  state: (): ModalState => ({
    isOpen: false,
  }),
  getters: {
    hiddenClass(state): string {
      return !state.isOpen ? 'hidden' : '';
    },
  },
  actions: {
    toggleModal() {
      this.isOpen = !this.isOpen
    },
  },
});