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

66 lines (65 loc) • 2.16 kB
JavaScript
import { jsx as r } from "../../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { getCommonErrorMessage as l } from "../getCommonErrorCode.js";
import n from "../../internal/CopyText/CopyText.js";
const t = {
contactSupportForHelp: "contactSupportForHelp",
couldNotLoadOffers: "capital.weCouldNotLoadFinancialOffers",
tryRefreshingThePage: "tryRefreshingThePageOrComeBackLater",
somethingWentWrong: "somethingWentWrong"
}, a = {
title: t.somethingWentWrong,
message: [t.couldNotLoadOffers, t.tryRefreshingThePage],
refreshComponent: !0
}, d = (e, o) => {
if (!e) return a;
const i = l(e, o);
if (i) return i;
const s = o ? "theErrorCodeIs" : "contactSupportForHelpAndShareErrorCode";
switch (e.errorCode) {
case void 0:
return { ...a, ...o ? { onContactSupport: o } : {} };
case "30_016":
return {
title: t.somethingWentWrong,
message: [t.couldNotLoadOffers, s],
translationValues: {
[s]: e.requestId ? /* @__PURE__ */ r(n, { textToCopy: e.requestId }) : null
},
onContactSupport: o
};
case "30_011":
return {
title: "capital.accountIsInactive",
message: [t.couldNotLoadOffers, s],
translationValues: {
[s]: e.requestId ? /* @__PURE__ */ r(n, { textToCopy: e.requestId }) : null
},
onContactSupport: o
};
case "30_600":
return {
title: t.somethingWentWrong,
message: ["capital.weCouldNotContinueWithTheOffer", s],
translationValues: {
[s]: e.requestId ? /* @__PURE__ */ r(n, { textToCopy: e.requestId }) : null
},
onContactSupport: o
};
case "EMPTY_CONFIG":
return {
title: t.somethingWentWrong,
message: ["capital.weCouldNotContinueWithTheOffer", t.contactSupportForHelp]
};
case "UNSUPPORTED_REGION":
return {
title: "capital.unsupportedRegionTitle",
message: "capital.unsupportedRegionDescription"
};
default:
return { ...a, refreshComponent: !0 };
}
};
export {
t as COMMON_CAPITAL_ERROR_MESSAGE,
d as getCapitalErrorMessage
};