"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var styles = {
  wrapper: {
    textAlign: 'center'
  },
  title: {
    paddingTop: 50,
    paddingBottom: 25
  },
  button: {
    display: 'block',
    margin: 'auto'
  },
  error: {
    display: 'inline-block',
    textAlign: 'left',
    paddingTop: 25
  },
  errorText: {
    color: 'red'
  },
  label: {
    fontWeight: 'bold',
    marginTop: 15
  }
};
var ErrorPage = function ErrorPage(_ref) {
  var _ref$error = _ref.error,
    error = _ref$error === void 0 ? null : _ref$error,
    _ref$info = _ref.info,
    info = _ref$info === void 0 ? null : _ref$info;
  return /*#__PURE__*/_react["default"].createElement("div", {
    style: styles.wrapper
  }, /*#__PURE__*/_react["default"].createElement("h1", {
    style: styles.title
  }, "Something went wrong."), /*#__PURE__*/_react["default"].createElement("button", {
    style: styles.button,
    onClick: window.location.reload
  }, /*#__PURE__*/_react["default"].createElement("i", {
    className: "ion-refresh"
  })), error && /*#__PURE__*/_react["default"].createElement("pre", {
    style: styles.error
  }, /*#__PURE__*/_react["default"].createElement("span", {
    style: styles.errorText
  }, error.toString()), /*#__PURE__*/_react["default"].createElement("div", {
    style: styles.label
  }, "JS Stack:"), error.stack && error.stack.match(/((^.+\n){6})/m)[0], /*#__PURE__*/_react["default"].createElement("div", {
    style: styles.label
  }, "Component Stack:"), info.componentStack.replace(/^\n+/, '')));
};
var _default = exports["default"] = ErrorPage;