"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 _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

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

var _dialog = require("../dialog");

var _typography = require("../typography");

var _box = require("../box");

var _button = require("../button");

var _uiIllustrations = require("@teamleader/ui-illustrations");

var _excluded = ["primaryAction", "secondaryAction", "title", "body", "type"];

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 = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  return /*#__PURE__*/_react.default.createElement(_dialog.DialogBase, (0, _extends2.default)({}, otherProps, {
    scrollable: false,
    size: "small"
  }), /*#__PURE__*/_react.default.createElement(_box.Box, {
    alignItems: "center",
    display: "flex",
    flexDirection: "column",
    padding: 4,
    textAlign: "center"
  }, /*#__PURE__*/_react.default.createElement(_box.Box, {
    marginBottom: 3,
    marginTop: 2
  }, type === 'confirm' ? /*#__PURE__*/_react.default.createElement(_uiIllustrations.Illustration60X60Info, null) : /*#__PURE__*/_react.default.createElement(_uiIllustrations.Illustration60X60Error, null)), /*#__PURE__*/_react.default.createElement(_typography.Heading3, {
    color: "teal"
  }, title), body && /*#__PURE__*/_react.default.createElement(_typography.TextBody, {
    color: "teal",
    marginTop: 2
  }, body), /*#__PURE__*/_react.default.createElement(_button.Button, (0, _extends2.default)({
    level: type === 'destructive' ? _button.BUTTON_LEVELS.destructive : _button.BUTTON_LEVELS.primary
  }, primaryAction, {
    fullWidth: true,
    marginTop: 5
  })), secondaryAction && /*#__PURE__*/_react.default.createElement(_button.Button, (0, _extends2.default)({}, secondaryAction, {
    fullWidth: true,
    marginTop: 2
  }))));
};

var _default = Alert;
exports.default = _default;