"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _react = _interopRequireDefault(require("react"));

var _reactRedux = require("react-redux");

var _tripTools = _interopRequireDefault(require("../narrative/trip-tools"));

var _state = require("../../util/state");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

const ErrorMessage = ({
  message
}) => {
  if (!message) return null;
  return /*#__PURE__*/_react.default.createElement("div", {
    className: "error-message"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "header"
  }, /*#__PURE__*/_react.default.createElement("i", {
    className: "fa fa-exclamation-circle"
  }), " Could Not Plan Trip"), /*#__PURE__*/_react.default.createElement("div", {
    className: "message"
  }, message), /*#__PURE__*/_react.default.createElement(_tripTools.default, {
    buttonTypes: ['START_OVER', 'REPORT_ISSUE']
  }));
}; // connect to the redux store


const mapStateToProps = (state, ownProps) => {
  return {
    message: (0, _state.getErrorMessage)((0, _state.getActiveError)(state), state.otp.config.errorMessages)
  };
};

const mapDispatchToProps = (dispatch, ownProps) => {
  return {};
};

var _default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(ErrorMessage);

exports.default = _default;
module.exports = exports.default;

//# sourceMappingURL=error-message.js