Added ErrorAlert component

This commit is contained in:
Abhinav-grd 2021-02-02 18:08:28 +05:30
parent bc709d5961
commit 50dc915401

View file

@ -0,0 +1,22 @@
import React from "react";
import { Alert } from "react-bootstrap";
import constants from "utils/strings/constants";
export function ErrorAlert({ errorCode }) {
let errorMessage;
switch (errorCode) {
case 402:
errorMessage = constants.SUBSCRIPTION_EXPIRED;
break;
case 426:
errorMessage = constants.STORAGE_QUOTA_EXCEEDED;
default:
errorMessage = errorCode;
}
console.log(errorCode);
return (
<Alert variant={'danger'} style={{ display: errorCode ? 'block' : 'none' }}>
{errorMessage}
</Alert>
)
}