"use strict";

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

var _core = require("@emotion/core");

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

var _DialogTitle = _interopRequireDefault(require("@material-ui/core/DialogTitle"));

var _Dialog = _interopRequireDefault(require("@material-ui/core/Dialog"));

var _shortid = require("shortid");

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

var _uiThemes = require("@hackoregon/ui-themes");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var titleId = (0, _shortid.generate)();

var Dialog = function Dialog(_ref) {
  var title = _ref.title,
      open = _ref.open,
      onClose = _ref.onClose,
      children = _ref.children;
  return (0, _core.jsx)(_styles.ThemeProvider, {
    theme: _uiThemes.MaterialTheme
  }, (0, _core.jsx)(_Dialog["default"], {
    onClose: onClose,
    "aria-labelledby": titleId,
    open: open
  }, title && (0, _core.jsx)(_DialogTitle["default"], {
    id: titleId
  }, title), children));
};

Dialog.propTypes = {
  title: _propTypes["default"].string,
  open: _propTypes["default"].bool,
  onClose: _propTypes["default"].func,
  children: _propTypes["default"].node
};
Dialog.displayName = "Dialog";
var _default = Dialog;
exports["default"] = _default;