import { n as useTranslation } from "./i18n-DoP1NB7u.js";
import { v as u, x as k } from "./vendor-preact-DThS2ZQ_.js";
import { t as Page } from "./page-DidH_RkX.js";
import { t as Spinner } from "./spinner-DqB4SGUV.js";
import { t as Button } from "./button-BMYTQ8fc.js";
import { t as ErrorIcon } from "./errorIcon-BA4T6iy-.js";
import { h as WarningIcon } from "./icons-CJJbIpBq.js";
import { t as SuccessIcon } from "./successIcon-B5mGvdx1.js";
import { t as AutoFocusTitle } from "./autoFocusTitle-CuRu2lPg.js";
//#region src/shared/verificationResult/verificationResult.tsx
var VerificationResult = ({ status, submittingTitle, successTitle, failureTitle, warningTitle, submittingSubtitle, onRetry, onSkip, retryLabel, skipLabel, hideFooterBranding = true, footerBrandingSlot }) => {
	const { t } = useTranslation();
	const hasActions = Boolean(onRetry || onSkip);
	const buildResultContent = () => {
		if (status === "submitting") return {
			mainContent: /* @__PURE__ */ u(Spinner, {
				title: submittingTitle ?? t("verification.processing"),
				subtitle: submittingSubtitle
			}),
			showActions: false
		};
		const iconByStatus = {
			success: /* @__PURE__ */ u(SuccessIcon, { size: 64 }),
			warning: /* @__PURE__ */ u(WarningIcon, { size: 40 }),
			failure: /* @__PURE__ */ u(ErrorIcon, { size: 64 })
		};
		const titleByStatus = {
			success: successTitle ?? t("verification.successTitle"),
			warning: warningTitle ?? t("verification.failureTitle"),
			failure: failureTitle ?? t("verification.failureTitle")
		};
		return {
			mainContent: /* @__PURE__ */ u(k, { children: [iconByStatus[status], /* @__PURE__ */ u(AutoFocusTitle, {
				className: "IncodeVerificationResult__title",
				children: titleByStatus[status]
			})] }),
			showActions: status === "warning" || status === "failure"
		};
	};
	const resultContent = buildResultContent();
	return /* @__PURE__ */ u(Page, {
		className: "IncodeVerificationResult",
		hideFooterBranding,
		footerBrandingSlot,
		children: [/* @__PURE__ */ u("div", {
			className: "IncodeVerificationResult__center",
			children: resultContent.mainContent
		}), resultContent.showActions && hasActions ? /* @__PURE__ */ u("div", {
			className: "IncodeVerificationResult__actions",
			children: [onRetry && /* @__PURE__ */ u(Button, {
				onClick: onRetry,
				"data-testid": "verification-retry",
				children: retryLabel ?? t("common.tryAgain")
			}), onSkip && /* @__PURE__ */ u(Button, {
				onClick: onSkip,
				variant: "secondary",
				"data-testid": "verification-skip",
				children: skipLabel ?? t("common.skip")
			})]
		}) : null]
	}, status);
};
//#endregion
export { VerificationResult as t };
