import { jsx as i, jsxs as p } from "react/jsx-runtime";
import { getCurrencySymbol as u, prettifyCurrencyValue as d, prettifyTokenAmount as x, ensureDecimals as b } from "@argent/x-shared";
import { useCurrency as g } from "../../../providers/CurrencyProvider.js";
import { useToken as h } from "../../../providers/TokenProvider.js";
import { Text as l } from "@chakra-ui/react";
const a = ({ tokenAddress: c, amount: n, fiatAmount: r, networkId: m }) => {
  const e = h({ address: c, networkId: m }), o = g(), t = (o == null ? void 0 : o.symbol) || u((r == null ? void 0 : r.currency) ?? "USD"), s = d(r == null ? void 0 : r.currencyAmount, t);
  if (!e)
    return /* @__PURE__ */ i(l, { ml: "auto", textAlign: "right", children: s });
  const y = x({
    amount: n,
    decimals: b(e.decimals),
    symbol: e.symbol
  });
  return /* @__PURE__ */ p(l, { ml: "auto", textAlign: "right", children: [
    y,
    " (",
    s,
    ")"
  ] });
};
export {
  a as TokenAndAmountValue
};
