"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

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

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _classnames = _interopRequireDefault(require("classnames"));

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

var _Alert = _interopRequireDefault(require("../Alert"));

var _Icon = _interopRequireDefault(require("../Icon"));

var _constants = require("../../constants");

var _intentIconMap = require("../intentIconMap");

// Copyright 1999-2020. Plesk International GmbH. All rights reserved.

/**
 * `StatusMessage` is used for notifying users about events happened (or going to happen) in the system.
 * For showing results of performed operations [Toaster](#!/Toaster) should be used.
 * @since 1.12.0
 */
const StatusMessage = ({
  baseClassName = `${_constants.CLS_PREFIX}status-message`,
  className,
  intent,
  children,
  ...props
}) => /*#__PURE__*/_react.default.createElement(_Alert.default, (0, _extends2.default)({
  className: (0, _classnames.default)(baseClassName, [`${baseClassName}--${intent}`], className),
  intent: intent
}, props), /*#__PURE__*/_react.default.createElement(_Icon.default, {
  name: _intentIconMap.intentIconMap[intent],
  className: `${baseClassName}__icon`
}), children);

var _default = StatusMessage;
exports.default = _default;