Files
opencode-manager/frontend/src/lib/toast.ts
T
Chris Scott 37b00e27ea feat: add global toast system with installation event notifications
- Add SSE event types for installation updates
- Implement global toast system using Sonner
- Add restart functionality directly in toast actions
- Update .gitignore to exclude temp directory
2025-11-29 09:48:40 -05:00

39 lines
855 B
TypeScript

import { toast } from 'sonner'
interface ToastOptions {
duration?: number
description?: string
action?: {
label: string
onClick: () => void
}
id?: string | number
}
export const showToast = {
success: (message: string, options?: ToastOptions) => {
return toast.success(message, options)
},
error: (message: string, options?: ToastOptions) => {
return toast.error(message, options)
},
info: (message: string, options?: ToastOptions) => {
return toast.info(message, options)
},
warning: (message: string, options?: ToastOptions) => {
return toast.warning(message, options)
},
loading: (message: string, options?: ToastOptions) => {
return toast.loading(message, options)
},
dismiss: (id?: string | number) => {
toast.dismiss(id)
}
}
export type ShowToast = typeof showToast