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

60 lines (59 loc) • 2.21 kB
JavaScript
import { jsx as i } from "../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { UNDEFINED_ERROR as a } from "../../../utils/getCommonErrorCode.js";
import c from "../../../internal/CopyText/CopyText.js";
const l = "ACCOUNT_MISCONFIGURATION", u = "WRONG_STORE_IDS", p = (e, t, r, n) => {
if (!e) return a;
const s = r ? "common.errors.errorCode" : "common.errors.errorCodeSupport", o = {
[s]: e.requestId ? /* @__PURE__ */ i(c, { copyButtonAriaLabelKey: "common.actions.copy.labels.errorCode", textToCopy: e.requestId }) : null
};
switch (e.errorCode) {
case l:
return {
title: "common.errors.somethingWentWrong",
message: ["payByLink.common.errors.accountConfiguration", "common.errors.contactSupport"],
translationValues: o,
onContactSupport: r
};
case u:
return {
title: "common.errors.somethingWentWrong",
message: ["payByLink.common.errors.storeID", "common.errors.contactSupport"],
translationValues: o,
onContactSupport: r
};
case "29_001":
return e.invalidFields?.some((m) => m.name === "paymentLinkId") ? {
title: "payByLink.overview.errors.listEmpty",
message: ["payByLink.overview.errors.listEmpty.message"],
images: {
desktop: n?.({ name: "no-results-found" }),
mobile: n?.({ name: "no-results-found", subFolder: "images/small" })
}
} : {
title: "common.errors.somethingWentWrong",
message: ["payByLink.overview.errors.couldNotLoadLinks", "common.errors.retry"],
onContactSupport: r
};
case "00_500":
case void 0:
return {
title: "common.errors.somethingWentWrong",
message: ["payByLink.overview.errors.couldNotLoadLinks", s],
translationValues: o,
refreshComponent: !0
};
default:
return {
title: "common.errors.somethingWentWrong",
message: [t, s],
translationValues: o,
onContactSupport: r,
refreshComponent: !0
};
}
};
export {
l as ACCOUNT_MISCONFIGURATION,
u as WRONG_STORE_IDS,
p as getPaymentLinksErrorMessage
};