import React from "preact/compat";
import { Dialog } from "../Dialog";
import { Button } from "../Button";
export var IdleTimeoutDialog = function IdleTimeoutDialog(_ref) {
  var continueSessionText = _ref.continueSessionText,
    heading = _ref.heading,
    endSessionButtonText = _ref.endSessionButtonText,
    endSessionUrl = _ref.endSessionUrl,
    isOpen = _ref.isOpen,
    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__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
      variation: "solid",
      className: continueSessionButtonClasses,
      onClick: onSessionContinue
    }, continueSessionText), showSessionEndButton ? /*#__PURE__*/React.createElement(Button, {
      href: endSessionUrl,
      onClick: onSessionForcedEnd
    }, endSessionButtonText) : null);
  };
  return /*#__PURE__*/React.createElement(Dialog, {
    alert: true,
    id: "session-timeout-dialog",
    isOpen: isOpen,
    heading: heading,
    actions: renderDialogActions(),
    onExit: onClose
  }, message);
};
export default IdleTimeoutDialog;