UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

66 lines (65 loc) 2.16 kB
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 };