import { notification } from "antd";
import {
CheckCircleOutlined,
CloseCircleOutlined,
ExclamationCircleOutlined,
InfoCircleOutlined,
} from "@ant-design/icons";
notification.config({
placement: "topRight",
top: 24,
duration: 3,
maxCount: 3,
});
const Toast = {
success: (message: string, description = "", duration = 3) => {
notification.success({
message,
description,
duration,
icon: ,
style: {
borderRadius: "8px",
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
},
});
},
error: (message: string, description = "", duration = 3) => {
notification.error({
message,
description,
duration,
icon: ,
style: {
borderRadius: "8px",
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
},
});
},
warning: (message: string, description = "", duration = 3) => {
notification.warning({
message,
description,
duration,
icon: ,
style: {
borderRadius: "8px",
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
},
});
},
info: (message: string, description = "", duration = 3) => {
notification.info({
message,
description,
duration,
icon: ,
style: {
borderRadius: "8px",
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
},
});
},
custom: (config: Record) => {
notification.open({
...config,
style: {
borderRadius: "8px",
boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)",
...config.style,
},
});
},
};
export default Toast;