UNPKG

react-healthy

Version:

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

16 lines (9 loc) 1.08 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var React = require('react'); var css = require('@emotion/css'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } var React__default = /*#__PURE__*/_interopDefaultLegacy(React); 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__default["default"].createElement("div",{className:css.cx(bannerStyles,b?"error":void 0),"data-testid":"banner"},b?d:e)}const bannerStyles=css.css({padding:"15px",borderRadius:"4px",fontSize:"20px",fontFamily:"inherit",backgroundColor:"#2ecc71",color:"white",marginBottom:"60px","&.error":{backgroundColor:"#ef5350"}}); exports.PageStatus = PageStatus; exports["default"] = PageStatus;