Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@bmc/react-common / dist / ErrorAlert.js
Size: Mime:
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _possibleConstructorReturn from "@babel/runtime/helpers/esm/possibleConstructorReturn";
import _getPrototypeOf from "@babel/runtime/helpers/esm/getPrototypeOf";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import React from 'react';
import { Alert } from 'react-bootstrap';
import './ErrorAlert.css';

var ErrorAlert =
/*#__PURE__*/
function (_React$Component) {
  _inherits(ErrorAlert, _React$Component);

  function ErrorAlert() {
    _classCallCheck(this, ErrorAlert);

    return _possibleConstructorReturn(this, _getPrototypeOf(ErrorAlert).apply(this, arguments));
  }

  _createClass(ErrorAlert, [{
    key: "render",
    value: function render() {
      var glyphStyle = {
        paddingRight: '0.5em',
        fontSize: '1em'
      };

      if (this.props.errors && this.props.errors.length > 0) {
        if (this.props.errors.length > 1) {
          return React.createElement(Alert, {
            bsStyle: "danger"
          }, this.props.title && React.createElement("div", null, React.createElement("h4", null, React.createElement("i", {
            style: glyphStyle,
            className: "fa fa-exclamation-triangle",
            "aria-hidden": "true"
          }), this.props.title), React.createElement("hr", null)), React.createElement("ul", null, this.props.errors.map(function (err, index) {
            return React.createElement("li", {
              key: index
            }, err);
          })));
        } else {
          return React.createElement(Alert, {
            variant: "danger"
          }, this.props.title && React.createElement("div", null, React.createElement("h4", null, React.createElement("i", {
            style: glyphStyle,
            className: "fa fa-exclamation-triangle",
            "aria-hidden": "true"
          }), this.props.title), React.createElement("hr", null)), React.createElement("p", null, this.props.errors[0]));
        }
      } else {
        return null;
      }
    }
  }]);

  return ErrorAlert;
}(React.Component);

export default ErrorAlert;
//# sourceMappingURL=ErrorAlert.js.map