"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.IdleTimeoutDialog = void 0;
var _compat = _interopRequireDefault(require("preact/compat"));
var _Dialog = require("../Dialog");
var _Button = require("../Button");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var IdleTimeoutDialog = function IdleTimeoutDialog(_ref) {
  var continueSessionText = _ref.continueSessionText,
    heading = _ref.heading,
    endSessionButtonText = _ref.endSessionButtonText,
    endSessionUrl = _ref.endSessionUrl,
    message = _ref.message,
    onClose = _ref.onClose,
    onSessionContinue = _ref.onSessionContinue,
    onSessionForcedEnd = _ref.onSessionForcedEnd,
    showSessionEndButton = _ref.showSessionEndButton;
  var renderDialogActions = function renderDialogActions() {
    var continueSessionButtonClasses = showSessionEndButton ? 'ds-u-margin-right--2' : null;
    return /*#__PURE__*/_compat.default.createElement(_compat.default.Fragment, null, /*#__PURE__*/_compat.default.createElement(_Button.Button, {
      variation: "solid",
      className: continueSessionButtonClasses,
      onClick: onSessionContinue
    }, continueSessionText), showSessionEndButton ? /*#__PURE__*/_compat.default.createElement(_Button.Button, {
      href: endSessionUrl,
      onClick: onSessionForcedEnd
    }, endSessionButtonText) : null);
  };
  return /*#__PURE__*/_compat.default.createElement(_Dialog.Dialog, {
    alert: true,
    id: "session-timeout-dialog",
    heading: heading,
    actions: renderDialogActions(),
    onExit: onClose
  }, message);
};
exports.IdleTimeoutDialog = IdleTimeoutDialog;
var _default = IdleTimeoutDialog;
exports.default = _default;