import { jsx as t, jsxs as o } from "react/jsx-runtime";
import { getCurrencySymbol as b, prettifyTokenAmount as v, ensureDecimals as x, prettifyCurrencyValue as S } from "@argent/x-shared";
import { useCurrency as T } from "../../../providers/CurrencyProvider.js";
import { useTokenInfo as w } from "../../../providers/TokenProvider.js";
import { Flex as n } from "@chakra-ui/react";
import { useTranslation as I } from "react-i18next";
import { Hideable as C } from "../Hideable.js";
import { TokenActivitySummaryIcon as R } from "../icon/TokenActivitySummaryIcon.js";
import { ActivityRowSubtitle as j } from "./ActivityRowSubtitle.js";
import { getAttributes as z } from "./getAttributes.js";
import { UnknownTokenIcon as D } from "../../../../components/TokenIcon.js";
import { B3 as c } from "../../../../components/typography.generated.js";
const N = ({ summary: e, networkId: m, hideComponent: f }) => {
  var u, d;
  const { t: p } = I(), i = T(), y = e.asset.tokenAddress, r = w({
    networkId: m,
    address: y
  });
  if (!r)
    return /* @__PURE__ */ t(n, { alignItems: "center", w: "full", children: /* @__PURE__ */ o(n, { gap: "2", alignItems: "center", children: [
      /* @__PURE__ */ t(D, { size: 7 }),
      /* @__PURE__ */ t(c, { children: p("tokenActivitySummaryRow.unknownToken") })
    ] }) });
  const l = e.asset.amount || 0, s = (u = e.asset.fiatAmount) == null ? void 0 : u.currencyAmount, A = (i == null ? void 0 : i.symbol) || b(((d = e.asset.fiatAmount) == null ? void 0 : d.currency) ?? "USD"), a = v({
    amount: l,
    decimals: x(r.decimals),
    symbol: r.symbol
  }), { color: g, prefix: h } = z(e), k = S(s, A);
  return /* @__PURE__ */ o(n, { alignItems: "center", w: "full", children: [
    /* @__PURE__ */ o(n, { gap: "2", alignItems: "center", children: [
      /* @__PURE__ */ t(R, { summary: e, size: 7, networkId: m }),
      /* @__PURE__ */ t(c, { children: r.name })
    ] }),
    /* @__PURE__ */ t(n, { ml: "auto", gap: 1, direction: "column", textAlign: "right", children: /* @__PURE__ */ o(C, { hideComponent: f, children: [
      /* @__PURE__ */ o(c, { color: g, "data-tx-value": l, "data-fe-value": a, children: [
        h,
        a
      ] }),
      s !== void 0 && /* @__PURE__ */ t(j, { children: k })
    ] }) })
  ] });
};
export {
  N as TokenActivitySummaryRow
};
