"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _propTypes = _interopRequireDefault(require("prop-types"));
var _styles = require("@material-ui/core/styles");
var _ErrorRounded = _interopRequireDefault(require("@material-ui/icons/ErrorRounded"));
var _WarningRounded = _interopRequireDefault(require("@material-ui/icons/WarningRounded"));
var _CheckCircle = _interopRequireDefault(require("@material-ui/icons/CheckCircle"));
var _clsx = _interopRequireDefault(require("clsx"));
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var useStyles = (0, _styles.makeStyles)(function (theme) {
  return {
    root: {
      borderRadius: '4px',
      color: '#fff',
      padding: '10px 16px',
      display: 'flex',
      alignItems: 'center'
    },
    successRoot: {
      backgroundColor: theme.palette.primary.success
    },
    warningRoot: {
      backgroundColor: theme.palette.primary.warning
    },
    errorRoot: {
      backgroundColor: theme.palette.primary.error
    },
    messageText: {
      color: '#fff',
      fontWeight: 500,
      fontSize: 15
    },
    icon: {
      marginRight: 8
    }
  };
}, {
  name: 'MessageBox'
});
var MessageBox = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
  var text = _ref.text,
    type = _ref.type;
  var classes = useStyles();
  return /*#__PURE__*/_react["default"].createElement("div", {
    ref: ref,
    className: (0, _clsx["default"])(classes.root, classes["".concat(type, "Root")])
  }, type === 'success' && /*#__PURE__*/_react["default"].createElement(_CheckCircle["default"], {
    className: classes.icon
  }), type === 'warning' && /*#__PURE__*/_react["default"].createElement(_WarningRounded["default"], {
    className: classes.icon
  }), type === 'error' && /*#__PURE__*/_react["default"].createElement(_ErrorRounded["default"], {
    className: classes.icon
  }), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
    variant: "body1",
    className: classes.messageText
  }, text));
});
MessageBox.defaultProps = {
  type: 'success'
};
var _default = exports["default"] = MessageBox;