diff --git a/src/stores/alerts.ts b/src/stores/alerts.ts index 6f91f208..eff40c96 100644 --- a/src/stores/alerts.ts +++ b/src/stores/alerts.ts @@ -1,22 +1,8 @@ -import { defineStore } from 'pinia'; -import { AlertSeverity, AlertType } from '@/types/alertTypes'; - -export const useAlertsStore = defineStore('alerts', { - state: () => { - return { activeMessages: [] as AlertType[] }; - }, - actions: { - addAlert(message: AlertType) { - this.activeMessages.push(message); - }, - removeAlert(alert: AlertType) { - console.log('dismissed', alert); - this.activeMessages = this.activeMessages.filter((v) => v !== alert); - }, - }, -}); +import { AlertSeverity } from '@/types/alertTypes'; +import { useToast } from 'bootstrap-vue-next'; export function showAlert(message: string, severity: AlertSeverity = 'warning') { - const alertsStore = useAlertsStore(); - alertsStore.addAlert({ message, severity, timeout: 5000 }); + const { show } = useToast(); + + show(message, { title: 'Msg', variant: severity, animation: true, value: true }); }