import _extends from "@babel/runtime/helpers/extends";
// Copyright 1999-2020. Plesk International GmbH. All rights reserved.
import classNames from 'classnames';
import React from 'react';
import Alert from '../Alert';
import Icon from '../Icon';
import { CLS_PREFIX } from '../../constants';
import { intentIconMap } from '../intentIconMap';

/**
 * `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 = `${CLS_PREFIX}status-message`,
  className,
  intent,
  children,
  ...props
}) => /*#__PURE__*/React.createElement(Alert, _extends({
  className: classNames(baseClassName, [`${baseClassName}--${intent}`], className),
  intent: intent
}, props), /*#__PURE__*/React.createElement(Icon, {
  name: intentIconMap[intent],
  className: `${baseClassName}__icon`
}), children);

export default StatusMessage;