/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { Button } from "../../core/Button/Button2.js";
import "../../core/Button/index.js";
import { PageOverlay } from "../../core/PageOverlay/PageOverlay.js";
import "../../core/PageOverlay/index.js";
import { jsx, jsxs } from "react/jsx-runtime";
//#region src/blocks/SessionWarning/SessionWarning.tsx
/**
* SessionWarning displays a full-screen overlay warning users about
* session expiration, giving them time to save their work.
*
* This is a pure presentational component. The parent component is
* responsible for managing state and handling user actions.
*
* @example
* ```tsx
* <SessionWarning
*   isOpen={isExpired}
*   onLoginNow={() => router.refresh()}
*   onDismiss={() => setWarning(null)}
*   messages={{
*     title: t('title.expired'),
*     description: t('description.expired'),
*     tip: t('tip'),
*     loginButton: t('login'),
*     dismissButton: t('dismiss'),
*   }}
* />
* ```
*/
function SessionWarning({ isOpen, onLoginNow, onDismiss, isLoading = false, messages }) {
	if (!isOpen) return null;
	return /* @__PURE__ */ jsx(PageOverlay, {
		status: "warning",
		fullScreen: true,
		children: /* @__PURE__ */ jsxs("div", {
			className: "space-y-4",
			children: [
				/* @__PURE__ */ jsx("h1", {
					className: "text-2xl font-bold",
					children: messages.title
				}),
				/* @__PURE__ */ jsx("p", {
					className: "text-lg",
					children: messages.description
				}),
				messages.tip && /* @__PURE__ */ jsx("p", {
					className: "text-sm text-(--text-muted)",
					children: messages.tip
				}),
				/* @__PURE__ */ jsxs("div", {
					className: "flex gap-3 pt-4",
					children: [/* @__PURE__ */ jsx(Button, {
						variant: "primary",
						onClick: onLoginNow,
						loading: isLoading,
						children: messages.loginButton
					}), /* @__PURE__ */ jsx(Button, {
						variant: "outline",
						onClick: onDismiss,
						disabled: isLoading,
						children: messages.dismissButton
					})]
				})
			]
		})
	});
}
//#endregion
export { SessionWarning };

//# sourceMappingURL=SessionWarning.js.map