"use strict";

exports.__esModule = true;
exports.default = void 0;
var _keys2 = _interopRequireDefault(require("lodash/fp/keys"));
var _get2 = _interopRequireDefault(require("lodash/fp/get"));
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _classnames = _interopRequireDefault(require("classnames"));
var _novaIcons = require("@coorpacademy/nova-icons");
var _notification = _interopRequireDefault(require("./notification.css"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const NOTIFICATION_ICON = {
  addFavorite: _novaIcons.NovaCompositionCoorpacademyCheck,
  removeFavorite: _novaIcons.NovaCompositionNavigationMore,
  lock: _novaIcons.NovaSolidLoginLocked,
  unlock: _novaIcons.NovaSolidLocksLockUnlock1
};
const handleOverlayClick = e => {
  e.stopPropagation();
  e.preventDefault();
  return false;
};
const Notification = props => {
  const {
    message,
    icon
  } = props;
  const IconType = (0, _get2.default)(icon, NOTIFICATION_ICON);
  return /*#__PURE__*/_react.default.createElement("div", {
    "data-name": "notification",
    "data-type": icon,
    onClick: handleOverlayClick,
    className: (0, _classnames.default)(_notification.default.showOverlay, _notification.default.notificationWrapper)
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: _notification.default.notification
  }, /*#__PURE__*/_react.default.createElement(IconType, {
    className: _notification.default.icon,
    style: {
      color: null
    },
    stroke: null
  }), /*#__PURE__*/_react.default.createElement("div", {
    className: _notification.default.message
  }, /*#__PURE__*/_react.default.createElement("span", {
    role: "status"
  }, message))));
};
Notification.propTypes = process.env.NODE_ENV !== "production" ? {
  message: _propTypes.default.string.isRequired,
  icon: _propTypes.default.oneOf((0, _keys2.default)(NOTIFICATION_ICON)).isRequired
} : {};
var _default = exports.default = Notification;
//# sourceMappingURL=notification.js.map