mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 09:40:30 +08:00
* feat: add toast notification system with snackbar component * feat: enhance chat functionality with conversation running state and notifications * fix: update bot message avatar rendering during streaming * feat: implement conversation tracking context manager for webchat * fix: update conversation tracking to remove conversation ID on exit
17 lines
490 B
JavaScript
17 lines
490 B
JavaScript
import { useToastStore } from '@/stores/toast'
|
|
|
|
export function useToast() {
|
|
const store = useToastStore()
|
|
|
|
const toast = (message, color = 'info', opts = {}) =>
|
|
store.add({ message, color, ...opts })
|
|
|
|
return {
|
|
toast,
|
|
success: (msg, opts) => toast(msg, 'success', opts),
|
|
error: (msg, opts) => toast(msg, 'error', opts),
|
|
info: (msg, opts) => toast(msg, 'primary', opts),
|
|
warning: (msg, opts) => toast(msg, 'warning', opts)
|
|
}
|
|
}
|