import ErrorNotification from "./ErrorNotification";
import WarningNotification from "./WarningNotification";
import SuccessNotification from "./successNotification";

const Notifications = async (directionApp, response, t) => {
  const { status, data } = response;

  switch (status) {
    case 200:
      SuccessNotification(directionApp, status, t);
      break;
    case 400:
      ErrorNotification(directionApp, status, t);
      break;
    case 401:
      ErrorNotification(directionApp, status, t);
      break;
    case 403:
      ErrorNotification(directionApp, status, t);
      break;
    case 422:
      ErrorNotification(directionApp, status, t, data.message);
      break;
    case 500:
      WarningNotification(directionApp, status, t);
      break;
    case 503:
      WarningNotification(directionApp, status, t);
      break;
    case 504:
      WarningNotification(directionApp, status, t);
      break;
    default:
      // Handle other cases if needed
      break;
  }
};

export default Notifications;
