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

33 lines (32 loc) • 927 B
JavaScript
import { jsx as m } from "../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { UNDEFINED_ERROR as n, getCommonErrorMessage as a } from "./getCommonErrorCode.js";
import i from "../internal/CopyText/CopyText.js";
const d = (e, t, r) => {
if (!e) return n;
const o = a(e, r);
if (o) return o;
switch (e.errorCode) {
case void 0:
return {
title: "somethingWentWrong",
message: [t, "tryRefreshingThePageOrComeBackLater"],
refreshComponent: !0
};
case "00_500": {
const s = r ? "theErrorCodeIs" : "contactSupportForHelpAndShareErrorCode";
return {
title: "somethingWentWrong",
message: [t, s],
translationValues: {
[s]: e.requestId ? /* @__PURE__ */ m(i, { textToCopy: e.requestId }) : null
},
onContactSupport: r
};
}
default:
return n;
}
};
export {
d as getErrorMessage
};