Added ErrorAlert component
This commit is contained in:
parent
bc709d5961
commit
50dc915401
1 changed files with 22 additions and 0 deletions
22
src/pages/gallery/components/ErrorAlert.tsx
Normal file
22
src/pages/gallery/components/ErrorAlert.tsx
Normal 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>
|
||||
)
|
||||
}
|
Loading…
Add table
Reference in a new issue