"use strict";

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

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

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _core = require("@material-ui/core");

var _styles = require("@material-ui/core/styles");

var AlertDialog = function AlertDialog(_ref) {
  var text = _ref.text,
      title = _ref.title,
      onClose = _ref.onClose,
      onConfirm = _ref.onConfirm,
      open = _ref.open,
      onCloseText = _ref.onCloseText,
      onConfirmText = _ref.onConfirmText,
      classes = _ref.classes;
  return /*#__PURE__*/_react["default"].createElement(_core.Dialog, {
    open: open,
    onClose: onClose
  }, title && /*#__PURE__*/_react["default"].createElement(_core.DialogTitle, {
    className: classes.heading
  }, title), text && /*#__PURE__*/_react["default"].createElement(_core.DialogContent, null, /*#__PURE__*/_react["default"].createElement(_core.DialogContentText, {
    className: classes.subheading
  }, text)), /*#__PURE__*/_react["default"].createElement(_core.DialogActions, null, onClose && /*#__PURE__*/_react["default"].createElement(_core.Button, {
    onClick: onClose,
    color: "primary"
  }, onCloseText), onConfirm && /*#__PURE__*/_react["default"].createElement(_core.Button, {
    autoFocus: true,
    onClick: onConfirm,
    color: "primary"
  }, onConfirmText)));
};

AlertDialog.defaultProps = {
  onCloseText: 'CANCEL',
  onConfirmText: 'OK'
};
AlertDialog.propTypes = {
  text: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].object]),
  title: _propTypes["default"].string,
  onClose: _propTypes["default"].func,
  onConfirm: _propTypes["default"].func,
  open: _propTypes["default"].bool,
  onConfirmText: _propTypes["default"].string,
  onCloseText: _propTypes["default"].string,
  classes: _propTypes["default"].object
};

var styles = function styles() {
  return {
    heading: {
      '& h2': {
        fontSize: 'max(1.25rem, 18px)'
      }
    },
    subheading: {
      fontSize: 'max(1rem, 14px)'
    }
  };
};

var _default = (0, _styles.withStyles)(styles)(AlertDialog);

exports["default"] = _default;
//# sourceMappingURL=alert-dialog.js.map