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

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