import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["primaryAction", "secondaryAction", "title", "body", "type"];
import React from 'react';
import { DialogBase } from '../dialog';
import { Heading3, TextBody } from '../typography';
import { Box } from '../box';
import { Button, BUTTON_LEVELS } from '../button';
import { Illustration60X60Error, Illustration60X60Info } from '@teamleader/ui-illustrations';

var Alert = function Alert(_ref) {
  var primaryAction = _ref.primaryAction,
      secondaryAction = _ref.secondaryAction,
      title = _ref.title,
      body = _ref.body,
      _ref$type = _ref.type,
      type = _ref$type === void 0 ? 'confirm' : _ref$type,
      otherProps = _objectWithoutProperties(_ref, _excluded);

  return /*#__PURE__*/React.createElement(DialogBase, _extends({}, otherProps, {
    scrollable: false,
    size: "small"
  }), /*#__PURE__*/React.createElement(Box, {
    alignItems: "center",
    display: "flex",
    flexDirection: "column",
    padding: 4,
    textAlign: "center"
  }, /*#__PURE__*/React.createElement(Box, {
    marginBottom: 3,
    marginTop: 2
  }, type === 'confirm' ? /*#__PURE__*/React.createElement(Illustration60X60Info, null) : /*#__PURE__*/React.createElement(Illustration60X60Error, null)), /*#__PURE__*/React.createElement(Heading3, {
    color: "teal"
  }, title), body && /*#__PURE__*/React.createElement(TextBody, {
    color: "teal",
    marginTop: 2
  }, body), /*#__PURE__*/React.createElement(Button, _extends({
    level: type === 'destructive' ? BUTTON_LEVELS.destructive : BUTTON_LEVELS.primary
  }, primaryAction, {
    fullWidth: true,
    marginTop: 5
  })), secondaryAction && /*#__PURE__*/React.createElement(Button, _extends({}, secondaryAction, {
    fullWidth: true,
    marginTop: 2
  }))));
};

export default Alert;