import { jsxs as c, jsx as f } from "react/jsx-runtime";
import { formatTruncatedAddress as l } from "@argent/x-shared";
import { useAddressName as x } from "../../../providers/AddressNameProvider.js";
import { useMemo as u } from "react";
import { useTranslation as A } from "react-i18next";
import y from "../../../logos/DappsLootboxLogo.js";
import { ActivityRowSubtitle as b } from "./ActivityRowSubtitle.js";
import { getCounterparty as D } from "./getCounterparty.js";
const T = ({ activity: r, suffix: m, networkId: n }) => {
  const { t: o } = A(), { transferSummary: d = [] } = r, p = d[0].sent, e = D(r), a = u(() => {
    var t;
    return r.details.type === "payment" && ((t = r.details.context) == null ? void 0 : t.isLootboxReward);
  }, [r]), i = x({
    networkId: n,
    address: e || ""
  });
  if (e) {
    let t = "", s;
    return a ? (t = o("activityAddressDescription.lootbox"), s = /* @__PURE__ */ f(y, { mr: 1, width: "14px", height: "14px" })) : (t = i || l(e), s = o(p ? "activityAddressDescription.to" : "activityAddressDescription.from")), /* @__PURE__ */ c(b, { display: "flex", alignItems: "center", children: [
      s,
      " ",
      t,
      m
    ] });
  }
};
export {
  T as ActivityAddressDescription
};
