import { ref } from 'vue'; export interface Toast { id: number; message: string; type: 'success' | 'error' | 'info'; } const toasts = ref([]); let nextId = 0; export function showToast(message: string, type: 'success' | 'error' | 'info' = 'info', duration = 3000) { const id = nextId++; toasts.value.push({ id, message, type }); setTimeout(() => { toasts.value = toasts.value.filter(t => t.id !== id); }, duration); } export function useToast() { return { toasts, showToast }; }