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

66 lines (65 loc) • 2.51 kB
JavaScript
import { jsx as s } from "../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { getCommonErrorMessage as m } from "../getCommonErrorCode.js";
import n from "../../internal/CopyText/CopyText.js";
const o = {
contactSupportForHelp: "common.errors.contactSupport",
couldNotLoadOffers: "capital.offer.common.errors.unavailable",
tryRefreshingThePage: "common.errors.retry",
somethingWentWrong: "common.errors.somethingWentWrong"
}, a = {
title: o.somethingWentWrong,
message: [o.couldNotLoadOffers, o.tryRefreshingThePage],
refreshComponent: !0
}, g = (e, r) => {
if (!e) return a;
const i = m(e, r);
if (i) return i;
const t = r ? "common.errors.errorCode" : "common.errors.errorCodeSupport";
switch (e.errorCode) {
case void 0:
return { ...a, ...r ? { onContactSupport: r } : {} };
case "30_016":
return {
title: o.somethingWentWrong,
message: [o.couldNotLoadOffers, t],
translationValues: {
[t]: e.requestId ? /* @__PURE__ */ s(n, { isUnderlineVisible: !0, copyButtonAriaLabelKey: "common.actions.copy.labels.errorCode", textToCopy: e.requestId }) : null
},
onContactSupport: r
};
case "30_011":
return {
title: "capital.offer.common.errors.accountInactive",
message: [o.couldNotLoadOffers, t],
translationValues: {
[t]: e.requestId ? /* @__PURE__ */ s(n, { isUnderlineVisible: !0, copyButtonAriaLabelKey: "common.actions.copy.labels.errorCode", textToCopy: e.requestId }) : null
},
onContactSupport: r
};
case "30_600":
return {
title: o.somethingWentWrong,
message: ["capital.offer.common.errors.cannotContinue", t],
translationValues: {
[t]: e.requestId ? /* @__PURE__ */ s(n, { isUnderlineVisible: !0, copyButtonAriaLabelKey: "common.actions.copy.labels.errorCode", textToCopy: e.requestId }) : null
},
onContactSupport: r
};
case "EMPTY_CONFIG":
return {
title: o.somethingWentWrong,
message: ["capital.offer.common.errors.cannotContinue", o.contactSupportForHelp]
};
case "UNSUPPORTED_REGION":
return {
title: "capital.common.errors.unsupportedRegion.title",
message: "capital.common.errors.unsupportedRegion"
};
default:
return { ...a, refreshComponent: !0 };
}
};
export {
o as COMMON_CAPITAL_ERROR_MESSAGE,
g as getCapitalErrorMessage
};