mirror of
https://github.com/langgenius/dify.git
synced 2026-05-29 21:27:54 +08:00
23 lines
407 B
TypeScript
23 lines
407 B
TypeScript
import type { ReactNode } from 'react'
|
|
import { toast } from '@/app/components/base/ui/toast'
|
|
|
|
type ToastType = 'success' | 'error' | 'warning' | 'info'
|
|
|
|
export type LegacyToastOptions = {
|
|
type?: ToastType
|
|
message: ReactNode
|
|
}
|
|
|
|
export const notifyToast = ({
|
|
type = 'info',
|
|
message,
|
|
}: LegacyToastOptions) => {
|
|
toast[type](message)
|
|
}
|
|
|
|
const Toast = {
|
|
notify: notifyToast,
|
|
}
|
|
|
|
export default Toast
|