import { jsx } from "@emotion/core";
import PropTypes from "prop-types";
import MaterialDialogTitle from "@material-ui/core/DialogTitle";
import MaterialDialog from "@material-ui/core/Dialog";
import { generate } from "shortid";
import { ThemeProvider } from "@material-ui/styles";
import { MaterialTheme } from "@hackoregon/ui-themes";
var titleId = generate();

var Dialog = function Dialog(_ref) {
  var title = _ref.title,
      open = _ref.open,
      onClose = _ref.onClose,
      children = _ref.children;
  return jsx(ThemeProvider, {
    theme: MaterialTheme
  }, jsx(MaterialDialog, {
    onClose: onClose,
    "aria-labelledby": titleId,
    open: open
  }, title && jsx(MaterialDialogTitle, {
    id: titleId
  }, title), children));
};

Dialog.propTypes = {
  title: PropTypes.string,
  open: PropTypes.bool,
  onClose: PropTypes.func,
  children: PropTypes.node
};
Dialog.displayName = "Dialog";
export default Dialog;