"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.IdleTimeoutDialog = void 0;
var _Dialog = require("../Dialog");
var _Button = require("../Button");
var _jsxRuntime = require("react/jsx-runtime");
const IdleTimeoutDialog = _ref => {
  let {
    continueSessionText,
    heading,
    endSessionButtonText,
    endSessionUrl,
    isOpen,
    message,
    onClose,
    onSessionContinue,
    onSessionForcedEnd,
    showSessionEndButton
  } = _ref;
  const renderDialogActions = () => {
    const continueSessionButtonClasses = showSessionEndButton ? 'ds-u-margin-right--2' : null;
    return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
      children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
        variation: "solid",
        className: continueSessionButtonClasses,
        onClick: onSessionContinue,
        children: continueSessionText
      }), showSessionEndButton ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
        href: endSessionUrl,
        onClick: onSessionForcedEnd,
        children: endSessionButtonText
      }) : null]
    });
  };
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Dialog.Dialog, {
    alert: true,
    id: "session-timeout-dialog",
    isOpen: isOpen,
    heading: heading,
    actions: renderDialogActions(),
    onExit: onClose,
    children: message
  });
};
exports.IdleTimeoutDialog = IdleTimeoutDialog;
var _default = exports.default = IdleTimeoutDialog;