UNPKG

react-healthy

Version:

Incrementally check and alert your users to the health of your APIs

7 lines (4 loc) 772 B
import React from 'react'; import { cx, css } from '@emotion/css'; const DEFAULT_MESSAGES={ERROR:"We are currently experiencing outages with our services. Stay tuned!",OPERATIONAL:"All services operational!"};function PageStatus(a){let{hasError:b,messages:c}=a;const d=(null===c||void 0===c?void 0:c.error)||DEFAULT_MESSAGES.ERROR,e=(null===c||void 0===c?void 0:c.operational)||DEFAULT_MESSAGES.OPERATIONAL;return/*#__PURE__*/React.createElement("div",{className:cx(bannerStyles,b?"error":void 0),"data-testid":"banner"},b?d:e)}const bannerStyles=css({padding:"15px",borderRadius:"4px",fontSize:"20px",fontFamily:"inherit",backgroundColor:"#2ecc71",color:"white",marginBottom:"60px","&.error":{backgroundColor:"#ef5350"}}); export { PageStatus, PageStatus as default };