Files
ragflow/web/src/components/ui/message.ts
Jin Hai 5714895291 Fix message duration (#12233)
### What problem does this PR solve?

As title

### Type of change

- [x] Refactoring

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2025-12-26 14:40:46 +08:00

36 lines
678 B
TypeScript

import { toast } from 'sonner';
const duration = { duration: 2500 };
const message = {
success: (msg: string) => {
toast.success(msg, {
position: 'top-center',
closeButton: false,
...duration,
});
},
error: (msg: string) => {
toast.error(msg, {
position: 'top-center',
closeButton: false,
...duration,
});
},
warning: (msg: string) => {
toast.warning(msg, {
position: 'top-center',
closeButton: false,
...duration,
});
},
info: (msg: string) => {
toast.info(msg, {
position: 'top-center',
closeButton: false,
...duration,
});
},
};
export default message;