import { jsx as a } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { useCallback as s, useMemo as m } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { ButtonVariant as u } from "../../../../internal/Button/types.js";
import { ErrorMessageDisplay as l } from "../../../../internal/ErrorMessageDisplay/ErrorMessageDisplay.js";
import c from "../../../../internal/Button/Button.js";
import { getPaymentLinkErrorMessage as f } from "./getPaymentLinkErrorMessage.js";
import p from "../../../../../core/Context/preact/useCoreContext.js";
const L = ({ error: o, onContactSupport: t, onDismiss: r }) => {
  const { i18n: e } = p(), n = s(() => /* @__PURE__ */ a(c, { variant: u.SECONDARY, onClick: r, children: e.get("payByLink.common.actions.goBack") }), [e, r]), i = m(
    () => f(o, "payByLink.details.errors.unavailable", t),
    [o, t]
  );
  return /* @__PURE__ */ a(
    l,
    {
      renderSecondaryButton: r ? n : void 0,
      withImage: !0,
      outlined: !1,
      absolutePosition: !1,
      withBackground: !1,
      ...i
    }
  );
};
export {
  L as PaymentLinkError
};
