@adyen/adyen-platform-experience-web
Version:

46 lines (45 loc) • 1.43 kB
JavaScript
import { jsx as r } from "../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { WITH_ERROR_CLASS as c } from "./constants.js";
import { ErrorMessageDisplay as e } from "../ErrorMessageDisplay/ErrorMessageDisplay.js";
import g from "classnames";
import { getErrorMessage as u } from "../../utils/getErrorMessage.js";
import { Fragment as f } from "../../../external/.pnpm/preact@10.28.2/node_modules/preact/dist/preact.module.js";
import { useConfigContext as p } from "../../../core/ConfigContext/preact/context.js";
function w({
balanceAccountsError: o,
children: n,
className: i,
errorMessage: t,
isBalanceAccountIdWrong: s,
onContactSupport: a
}) {
const { hasError: m } = p();
return /* @__PURE__ */ r("div", { className: g(i, { [c]: m }), children: m ? /* @__PURE__ */ r(
e,
{
withImage: !0,
centered: !0,
title: "common.errors.somethingWentWrong",
message: [t, "common.errors.retry"],
refreshComponent: !0
}
) : o ? /* @__PURE__ */ r(
e,
{
withImage: !0,
centered: !0,
...u(o, "common.errors.accountUnavailable", a)
}
) : s ? /* @__PURE__ */ r(
e,
{
withImage: !0,
centered: !0,
title: "common.errors.somethingWentWrong",
message: [t, "common.errors.accountInvalid"]
}
) : /* @__PURE__ */ r(f, { children: n }) });
}
export {
w as default
};