import { Alert as o } from "./accelbyte-widgets123.mjs";
import { CommonError as f } from "./accelbyte-widgets124.mjs";
import { AlertType as n } from "./accelbyte-widgets128.mjs";
import { UserHelper as c } from "./accelbyte-widgets277.mjs";
import { ERROR_LINK_ANOTHER_3RD_PARTY_ACCOUNT as d } from "@accelbyte/sdk";
import t from "react";
import { Trans as i } from "react-i18next";
const P = (s) => {
  const { error: m, accountConflictInformation: e, onDismiss: r } = s;
  if ((e == null ? void 0 : e.errorCode) === d && (e != null && e.previousLinkedPlatformAccount)) {
    const { platformID: a, platformUserID: p, platformDisplayName: u } = e.previousLinkedPlatformAccount, l = c.getPlatformName(a);
    return /* @__PURE__ */ t.createElement(o, { className: "mb-6", type: n.danger, onDismiss: r }, /* @__PURE__ */ t.createElement(i, { i18nKey: "LinkedAccountpage.cannotLinkWithAnotherAccount" }, "Unable to link this ", { platformName: l }, " account. Please link the ", { platformName: l }, " account previously linked to this account :", " ", { platformDisplayName: u }, " ( ", { platformUserID: p }, " )."));
  }
  if (e) {
    const a = c.getPlatformName(e.platformId);
    return /* @__PURE__ */ t.createElement(o, { className: "mb-6", type: n.danger, onDismiss: r }, /* @__PURE__ */ t.createElement(i, { i18nKey: "LinkedAccountPage.linkConflictError" }, "That ", { platformName: a }, " account has already been linked with another account.", /* @__PURE__ */ t.createElement("br", null), " Please contact support for assistance linking it with a different account."));
  }
  return m ? /* @__PURE__ */ t.createElement(o, { type: n.danger, className: "alert", onDismiss: r }, /* @__PURE__ */ t.createElement(f, { error: m })) : null;
};
export {
  P as LinkedAccountsErrorAlert
};
