import { reactive } from 'vue';

export const popupStore = reactive({
  messages: [],
  addPopupMessage(text) {
    const id = Date.now() + Math.random();
    this.messages.push({ id, text });

    setTimeout(() => {
      const index = this.messages.findIndex(msg => msg.id === id);
      if (index !== -1) this.messages.splice(index, 1);
    }, 3000);
  }
});
