2025-12-30 19:35:44 +08:00
|
|
|
import { ExternalToast, toast } from 'sonner';
|
2025-07-04 19:00:30 +08:00
|
|
|
|
2025-12-30 19:35:44 +08:00
|
|
|
const configuration: ExternalToast = { duration: 2500, position: 'top-center' };
|
2025-09-05 18:43:33 +08:00
|
|
|
|
2025-07-04 19:00:30 +08:00
|
|
|
const message = {
|
|
|
|
|
success: (msg: string) => {
|
2025-12-30 19:35:44 +08:00
|
|
|
toast.success(msg, configuration);
|
2025-07-04 19:00:30 +08:00
|
|
|
},
|
|
|
|
|
error: (msg: string) => {
|
2025-12-30 19:35:44 +08:00
|
|
|
toast.error(msg, configuration);
|
2025-07-04 19:00:30 +08:00
|
|
|
},
|
|
|
|
|
warning: (msg: string) => {
|
2025-12-30 19:35:44 +08:00
|
|
|
toast.warning(msg, configuration);
|
2025-07-04 19:00:30 +08:00
|
|
|
},
|
|
|
|
|
info: (msg: string) => {
|
2025-12-30 19:35:44 +08:00
|
|
|
toast.info(msg, configuration);
|
2025-07-04 19:00:30 +08:00
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
export default message;
|