"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
var _react = _interopRequireDefault(require("react"));
var _styles = require("@material-ui/core/styles");
var _i18n = require("../../../../Framework/i18n");
var _withWidth = _interopRequireDefault(require("@material-ui/core/withWidth"));
var _DialogContent = _interopRequireDefault(require("@material-ui/core/DialogContent"));
var _DialogActions = _interopRequireDefault(require("@material-ui/core/DialogActions"));
var _Typography = _interopRequireDefault(require("@material-ui/core/Typography"));
var _CustomDialog = _interopRequireDefault(require("../../../../Shared/Components/CustomDialog"));
var _MainButton = _interopRequireDefault(require("../../../../Shared/Components/MainButton"));
var _propTypes = _interopRequireDefault(require("prop-types"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
var useStyles = (0, _styles.makeStyles)(function (theme) {
  return {
    dialogTitleRoot: {
      padding: '12px 12px 20px',
      fontSize: '1.5rem',
      fontWeight: 400
    },
    dialogContentRoot: {
      padding: '0 24px 24px 12px'
    },
    sendEmailDialog: {
      borderTop: '7px solid ' + theme.palette.primary.main
    },
    activeButton: {
      padding: '4px 15px',
      textDecoration: 'none'
    },
    TypographyCaption: {
      fontSize: 12,
      lineHeight: 1.7
    }
  };
}, {
  name: 'SendEmail'
});
var SendEmail = function SendEmail(props) {
  var show = props.show,
    shareUrl = props.shareUrl,
    onClose = props.onClose;
  var emailUrl = "mailto:?subject=".concat((0, _i18n.t)('share.email.subject'), "&body=").concat((0, _i18n.t)('share.email.body', {
    shareUrl: window.encodeURIComponent(shareUrl)
  }));
  var classes = useStyles();
  return /*#__PURE__*/_react["default"].createElement(_CustomDialog["default"], {
    open: show,
    onClose: onClose,
    dialogTitle: (0, _i18n.t)('sendEmailDialog.title'),
    onCancel: onClose
  }, /*#__PURE__*/_react["default"].createElement(_DialogContent["default"], {
    className: classes.dialogContentRoot
  }, /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
    variant: "body1",
    classes: {
      root: classes.TypographyCaption
    },
    id: "alert-dialog-description"
  }, (0, _i18n.t)('sendEmailDialog.content')), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
    variant: "body1",
    classes: {
      root: classes.TypographyCaption
    },
    id: "alert-dialog-description"
  }, (0, _i18n.t)('sendEmailDialog.info'))), /*#__PURE__*/_react["default"].createElement(_DialogActions["default"], null, /*#__PURE__*/_react["default"].createElement(_MainButton["default"], {
    target: "_blank",
    href: emailUrl,
    onClick: onClose,
    variant: "contained",
    className: classes.activeButton
  }, (0, _i18n.t)('sendEmailDialog.actionButton'))));
};
var _default = exports["default"] = (0, _withWidth["default"])({
  initialWidth: 'lg'
})(SendEmail);