Files
Frontend/src/core/components/notifications/index.jsx

28 lines
1.1 KiB
JavaScript

import pendingNotification from "@/core/components/notifications/PendingNotification";
import WarningNotification from "@/core/components/notifications/WarningNotification";
import ErrorNotification from "@/core/components/notifications/ErrorNotification";
import SuccessNotification from "@/core/components/notifications/SuccessNotification";
const Notifications = (pushToastList, notificationType, t, status, message) => {
switch (notificationType) {
case "pending":
pendingNotification(pushToastList, notificationType, t);
break;
case "warning":
WarningNotification(pushToastList, notificationType, t, status);
break;
case "error":
if (message) {
ErrorNotification(pushToastList, notificationType, t, status, message)
} else {
ErrorNotification(pushToastList, notificationType, t, status)
}
break;
case "success":
SuccessNotification(pushToastList, notificationType, t, status);
break;
}
};
export default Notifications;