import { Dialog } from "../Dialog";
import { Button } from "../Button";
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "preact/compat/jsx-runtime";
export 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__*/_jsxs(_Fragment, {
      children: [/*#__PURE__*/_jsx(Button, {
        variation: "solid",
        className: continueSessionButtonClasses,
        onClick: onSessionContinue,
        children: continueSessionText
      }), showSessionEndButton ? /*#__PURE__*/_jsx(Button, {
        href: endSessionUrl,
        onClick: onSessionForcedEnd,
        children: endSessionButtonText
      }) : null]
    });
  };
  return /*#__PURE__*/_jsx(Dialog, {
    alert: true,
    id: "session-timeout-dialog",
    isOpen: isOpen,
    heading: heading,
    actions: renderDialogActions(),
    onExit: onClose,
    children: message
  });
};
export default IdleTimeoutDialog;