@gearbox-protocol/ui-kit 3.8.2 → 3.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
- package/dist/esm/components/composites/pool-table/columns.js +60 -60
- package/dist/types/components/composites/pool-table/columns.d.ts +2 -0
- package/dist/types/components/composites/pool-table/types.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),w=require("../../assets-list-cell/assets-list-cell.cjs"),j=require("../../compound-apy/compound-apy.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),w=require("../../assets-list-cell/assets-list-cell.cjs"),j=require("../../compound-apy/compound-apy.cjs"),d=require("../../description/description.cjs"),k=require("../../network-icon/network-icon.cjs"),C=require("../../percent-indicator/percent-indicator.cjs"),A=require("../../pool-apy-tooltip/pool-apy-tooltip.cjs"),I=require("../../pool-indicator-icon/pool-indicator-icon.cjs"),P=require("../../pool-points-indicator/pool-points-indicator.cjs"),u=require("../../skeleton/skeleton.cjs");require("react");require("@gearbox-protocol/sdk");require("clsx");require("tailwind-merge");require("sonner");const m=require("../../../utils/format-money.cjs"),f=require("../../../utils/templates.cjs");require("luxon");require("../../../utils/z-index.cjs");const _=require("../../token-symbol/token-symbol.cjs"),h=require("../../typed-intl/index.cjs"),q=require("../../../test-ids/pool-table.cjs");function a(e,o,l){const n=e?.header??t.jsx(h.FormattedMessageTyped,{messageId:e?.headerMessageId??o});let i;if(e?.headerTip!==null){const r=e?.headerTipMessageId??l;i=e?.headerTip??(r&&t.jsx(h.FormattedMessageTyped,{messageId:r}))}return{header:n,headerTip:i,mobileTitle:e?.mobileTitle??n}}function N({ctx:e}){const{pool:o,underlyingToken:l,points:n,apy:i,isMobile:r}=e,s=r?20:24,c=t.jsx(_.TokenSymbol,{token:l,size:s});return n&&n.length>0&&i?t.jsx(A.PoolAPYTooltip,{totalAPY:i.totalAPY,baseAPY:i.baseAPY,extraAPY:i.extraAPY,points:n,tokensList:e.tokensList,children:t.jsx("div",{children:t.jsx(I.PoolIndicatorIcon,{size:s,children:c})})}):o.hasPoints?t.jsx(P.PoolPointsIndicator,{size:s,children:c}):c}function v(e){const o=e.underlyingToken?.title??e.underlyingToken?.symbol??"",l=e.pool.version;return l&&l>=300&&l<310?`${o} v${Math.floor(l/100)}`:o}function D({ctx:e,renderDescription:o,getPoolName:l}){const{pool:n}=e,i=l?l(e):v(e);return t.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-3",children:[t.jsxs("div",{className:"flex items-center gap-3 shrink-0 leading-0",children:[n.network&&t.jsx(k.NetworkIcon,{network:n.network,isTest:!1,size:14,showTooltip:!0}),t.jsx(N,{ctx:e})]}),t.jsxs("div",{className:"flex md:flex-col min-w-0 overflow-hidden items-center md:items-start gap-2 md:gap-0",children:[t.jsx("span",{className:"truncate max-w-full",children:i}),o&&t.jsx(d.Description,{className:"min-w-0 text-xs",children:o(e)})]})]})}function S({ctx:e}){const{pool:o,underlyingToken:l,loading:n}=e;return t.jsxs("div",{className:"flex flex-col items-start md:items-end",children:[t.jsx(u.Skeleton,{loading:!!n,width:60,children:m.formatMoney(o.expectedLiquidityInUSD??0)}),t.jsx(d.Description,{children:f.tokenTemplate(o.expectedLiquidity,l)})]})}function M({ctx:e}){const{pool:o,underlyingToken:l,loading:n}=e;return t.jsxs("div",{className:"flex flex-col items-start md:items-end",children:[t.jsx(u.Skeleton,{loading:!!n,width:60,children:m.formatMoney(o.totalBorrowedInUSD??0)}),t.jsx(d.Description,{children:f.tokenTemplate(o.totalBorrowed,l)})]})}function Y({ctx:e}){const{pool:o,loading:l,underlyingToken:n}=e,i=n?.decimals??18,r=o.poolTokenSymbol!=null?{title:o.poolTokenSymbol,decimals:i}:n;return t.jsxs("div",{className:"flex flex-col items-start md:items-end","data-testid":q.poolTableTestIds.poolLineCellBalance,children:[t.jsx(u.Skeleton,{loading:!!l,width:60,children:m.formatMoney(o.userBalanceInUSD??0)}),o.userBalance!==void 0&&r&&t.jsx(d.Description,{children:f.tokenTemplate(o.userBalance,r)})]})}function z(e,o,l){const n=e.pool.collateralTokens,{tokensList:i,isMobile:r}=e,{mode:s="cascade",...c}=l??{};return!n?.length||!i?null:t.jsx(w.AssetsListCell,{maxAssets:o,tokensList:i,balances:n.map(p=>({token:p})),iconSize:r?20:24,options:{mode:s,...c}})}function B(e){const{header:o,mobileTitle:l}=a(e,"components.poolTable.pool");return{id:"pool",header:o,width:e?.width??"186px",align:"left",className:"pl-4",cell:n=>t.jsx(D,{ctx:n,renderDescription:e?.renderDescription,getPoolName:e?.getPoolName}),mobileTitle:l}}function L(e){const{header:o,mobileTitle:l}=a(e,"components.poolTable.supply");return{id:"supply",header:o,width:e?.width??"1fr",align:"right",hideOnMedium:e?.hideOnMedium,sort:e?.sortField!==void 0?{field:e.sortField,defaultDirection:"desc"}:{field:"supply",defaultDirection:"desc"},cell:n=>t.jsx(S,{ctx:n}),mobileTitle:l}}function F(e){const{header:o,headerTip:l,mobileTitle:n}=a(e,"components.poolTable.supplyApy","components.poolTable.supplyApy.tip");return{id:"supplyApy",header:o,headerTip:l,width:e?.width??"1.25fr",align:"right",sort:e?.sortField!==void 0?{field:e.sortField,defaultDirection:"desc"}:{field:"apy",defaultDirection:"desc"},cell:i=>{const{apy:r,loading:s,points:c,tokensList:p}=i,{totalAPY:y=0,baseAPY:g=[],extraAPY:x=[],externalAPY:b,apy7DAgo:T}=r??{};return t.jsx(u.Skeleton,{width:60,loading:!!s,children:t.jsx(j.CompoundAPY,{totalAPY:y,totalAPYLoading:!!s,baseAPY:g,extraAPY:x,points:c,apy7DAgo:T,tokensList:p,externalAPY:b})})},mobileTitle:n}}function O(e){const{header:o,mobileTitle:l}=a(e,"components.poolTable.borrowed");return{id:"borrowed",header:o,width:e?.width??"1.15fr",align:"right",cell:n=>t.jsx(M,{ctx:n}),mobileTitle:l}}function U(e){const{header:o,headerTip:l,mobileTitle:n}=a(e,"components.poolTable.borrowApy");return{id:"borrowApy",header:o,headerTip:l,width:e?.width??"150px",align:"right",cell:i=>{const r=i.pool.borrowAPY??e?.getBorrowRate?.(i.pool)??0;return t.jsx("div",{className:"flex justify-start md:justify-end",children:m.percentageTemplate(r)})},mobileTitle:n}}function R(e){const{header:o,mobileTitle:l}=a(e,"components.poolTable.utilization");return{id:"utilization",header:o,width:e?.width??"150px",align:"right",className:"pr-4",sort:e?.sortField!==void 0?{field:e.sortField,defaultDirection:"desc"}:{field:"utilization",defaultDirection:"desc"},cell:n=>{const i=n.pool.utilization??0;return t.jsx("div",{className:"flex justify-start md:justify-end",children:t.jsx(C.PercentIndicator,{percent:i})})},mobileTitle:l}}function $(e){const o=e?.maxAssets??5,l=r=>z(r,o,e?.options),{header:n,mobileTitle:i}=a(e,"components.poolTable.collateral");return{id:"collateral",header:n,width:e?.width??"148px",align:e?.align??"left",gapBefore:e?.gapBefore??"md",cell:e?.cell??l,mobileCell:e?.mobileCell??e?.cell??l,mobileTitle:i}}function H(e){const{header:o,mobileTitle:l}=a(e,"components.poolTable.balance");return{id:"balance",header:o,width:e?.width??"1.15fr",align:"right",className:e?.className??"pr-4",headerClassName:e?.headerClassName??"pr-4",sort:e?.sortField!==void 0?{field:e.sortField,defaultDirection:"desc"}:{field:"balance",defaultDirection:"desc"},cell:e?.cell??(n=>t.jsx(Y,{ctx:n})),mobileTitle:l}}function E(e){return e}exports.balanceColumn=H;exports.borrowApyColumn=U;exports.borrowedColumn=O;exports.collateralColumn=$;exports.customColumn=E;exports.poolColumn=B;exports.supplyApyColumn=F;exports.supplyColumn=L;exports.utilizationColumn=R;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
1
|
+
import { jsx as i, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { AssetsListCell as A } from "../../assets-list-cell/assets-list-cell.js";
|
|
3
3
|
import { CompoundAPY as C } from "../../compound-apy/compound-apy.js";
|
|
4
4
|
import { Description as m } from "../../description/description.js";
|
|
@@ -13,40 +13,40 @@ import "@gearbox-protocol/sdk";
|
|
|
13
13
|
import "clsx";
|
|
14
14
|
import "tailwind-merge";
|
|
15
15
|
import "sonner";
|
|
16
|
-
import { percentageTemplate as I, formatMoney as
|
|
17
|
-
import { tokenTemplate as
|
|
16
|
+
import { percentageTemplate as I, formatMoney as f } from "../../../utils/format-money.js";
|
|
17
|
+
import { tokenTemplate as h } from "../../../utils/templates.js";
|
|
18
18
|
import "luxon";
|
|
19
19
|
import "../../../utils/z-index.js";
|
|
20
20
|
import { TokenSymbol as Y } from "../../token-symbol/token-symbol.js";
|
|
21
|
-
import { FormattedMessageTyped as
|
|
21
|
+
import { FormattedMessageTyped as g } from "../../typed-intl/index.js";
|
|
22
22
|
import { poolTableTestIds as z } from "../../../test-ids/pool-table.js";
|
|
23
|
-
function
|
|
23
|
+
function d(e, l, o) {
|
|
24
24
|
const t = e?.header ?? /* @__PURE__ */ i(
|
|
25
|
-
|
|
25
|
+
g,
|
|
26
26
|
{
|
|
27
27
|
messageId: e?.headerMessageId ?? l
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
|
-
let
|
|
30
|
+
let n;
|
|
31
31
|
if (e?.headerTip !== null) {
|
|
32
|
-
const
|
|
33
|
-
|
|
32
|
+
const r = e?.headerTipMessageId ?? o;
|
|
33
|
+
n = e?.headerTip ?? (r && /* @__PURE__ */ i(g, { messageId: r }));
|
|
34
34
|
}
|
|
35
|
-
return { header: t, headerTip:
|
|
35
|
+
return { header: t, headerTip: n, mobileTitle: e?.mobileTitle ?? t };
|
|
36
36
|
}
|
|
37
37
|
function B({ ctx: e }) {
|
|
38
|
-
const { pool: l, underlyingToken: o, points: t, apy:
|
|
39
|
-
return t && t.length > 0 &&
|
|
38
|
+
const { pool: l, underlyingToken: o, points: t, apy: n, isMobile: r } = e, a = r ? 20 : 24, s = /* @__PURE__ */ i(Y, { token: o, size: a });
|
|
39
|
+
return t && t.length > 0 && n ? /* @__PURE__ */ i(
|
|
40
40
|
N,
|
|
41
41
|
{
|
|
42
|
-
totalAPY:
|
|
43
|
-
baseAPY:
|
|
44
|
-
extraAPY:
|
|
42
|
+
totalAPY: n.totalAPY,
|
|
43
|
+
baseAPY: n.baseAPY,
|
|
44
|
+
extraAPY: n.extraAPY,
|
|
45
45
|
points: t,
|
|
46
46
|
tokensList: e.tokensList,
|
|
47
|
-
children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(v, { size:
|
|
47
|
+
children: /* @__PURE__ */ i("div", { children: /* @__PURE__ */ i(v, { size: a, children: s }) })
|
|
48
48
|
}
|
|
49
|
-
) : l.hasPoints ? /* @__PURE__ */ i(D, { size:
|
|
49
|
+
) : l.hasPoints ? /* @__PURE__ */ i(D, { size: a, children: s }) : s;
|
|
50
50
|
}
|
|
51
51
|
function M(e) {
|
|
52
52
|
const l = e.underlyingToken?.title ?? e.underlyingToken?.symbol ?? "", o = e.pool.version;
|
|
@@ -57,9 +57,9 @@ function S({
|
|
|
57
57
|
renderDescription: l,
|
|
58
58
|
getPoolName: o
|
|
59
59
|
}) {
|
|
60
|
-
const { pool: t } = e,
|
|
61
|
-
return /* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */
|
|
60
|
+
const { pool: t } = e, n = o ? o(e) : M(e);
|
|
61
|
+
return /* @__PURE__ */ c("div", { className: "grid grid-cols-[auto_1fr] gap-x-3", children: [
|
|
62
|
+
/* @__PURE__ */ c("div", { className: "flex items-center gap-3 shrink-0 leading-0", children: [
|
|
63
63
|
t.network && /* @__PURE__ */ i(
|
|
64
64
|
P,
|
|
65
65
|
{
|
|
@@ -71,17 +71,17 @@ function S({
|
|
|
71
71
|
),
|
|
72
72
|
/* @__PURE__ */ i(B, { ctx: e })
|
|
73
73
|
] }),
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */ i("span", { className: "truncate max-w-full", children:
|
|
74
|
+
/* @__PURE__ */ c("div", { className: "flex md:flex-col min-w-0 overflow-hidden items-center md:items-start gap-2 md:gap-0", children: [
|
|
75
|
+
/* @__PURE__ */ i("span", { className: "truncate max-w-full", children: n }),
|
|
76
76
|
l && /* @__PURE__ */ i(m, { className: "min-w-0 text-xs", children: l(e) })
|
|
77
77
|
] })
|
|
78
78
|
] });
|
|
79
79
|
}
|
|
80
80
|
function F({ ctx: e }) {
|
|
81
81
|
const { pool: l, underlyingToken: o, loading: t } = e;
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
/* @__PURE__ */ i(u, { loading: !!t, width: 60, children:
|
|
84
|
-
/* @__PURE__ */ i(m, { children:
|
|
82
|
+
return /* @__PURE__ */ c("div", { className: "flex flex-col items-start md:items-end", children: [
|
|
83
|
+
/* @__PURE__ */ i(u, { loading: !!t, width: 60, children: f(l.expectedLiquidityInUSD ?? 0) }),
|
|
84
|
+
/* @__PURE__ */ i(m, { children: h(
|
|
85
85
|
l.expectedLiquidity,
|
|
86
86
|
o
|
|
87
87
|
) })
|
|
@@ -89,46 +89,46 @@ function F({ ctx: e }) {
|
|
|
89
89
|
}
|
|
90
90
|
function L({ ctx: e }) {
|
|
91
91
|
const { pool: l, underlyingToken: o, loading: t } = e;
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */ i(u, { loading: !!t, width: 60, children:
|
|
94
|
-
/* @__PURE__ */ i(m, { children:
|
|
92
|
+
return /* @__PURE__ */ c("div", { className: "flex flex-col items-start md:items-end", children: [
|
|
93
|
+
/* @__PURE__ */ i(u, { loading: !!t, width: 60, children: f(l.totalBorrowedInUSD ?? 0) }),
|
|
94
|
+
/* @__PURE__ */ i(m, { children: h(
|
|
95
95
|
l.totalBorrowed,
|
|
96
96
|
o
|
|
97
97
|
) })
|
|
98
98
|
] });
|
|
99
99
|
}
|
|
100
100
|
function j({ ctx: e }) {
|
|
101
|
-
const { pool: l, loading: o, underlyingToken: t } = e,
|
|
101
|
+
const { pool: l, loading: o, underlyingToken: t } = e, n = t?.decimals ?? 18, r = l.poolTokenSymbol != null ? {
|
|
102
102
|
title: l.poolTokenSymbol,
|
|
103
|
-
decimals:
|
|
103
|
+
decimals: n
|
|
104
104
|
} : t;
|
|
105
|
-
return /* @__PURE__ */
|
|
105
|
+
return /* @__PURE__ */ c(
|
|
106
106
|
"div",
|
|
107
107
|
{
|
|
108
108
|
className: "flex flex-col items-start md:items-end",
|
|
109
109
|
"data-testid": z.poolLineCellBalance,
|
|
110
110
|
children: [
|
|
111
|
-
/* @__PURE__ */ i(u, { loading: !!o, width: 60, children:
|
|
112
|
-
l.userBalance !== void 0 &&
|
|
111
|
+
/* @__PURE__ */ i(u, { loading: !!o, width: 60, children: f(l.userBalanceInUSD ?? 0) }),
|
|
112
|
+
l.userBalance !== void 0 && r && /* @__PURE__ */ i(m, { children: h(l.userBalance, r) })
|
|
113
113
|
]
|
|
114
114
|
}
|
|
115
115
|
);
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
return !
|
|
117
|
+
function O(e, l, o) {
|
|
118
|
+
const t = e.pool.collateralTokens, { tokensList: n, isMobile: r } = e, { mode: a = "cascade", ...s } = o ?? {};
|
|
119
|
+
return !t?.length || !n ? null : /* @__PURE__ */ i(
|
|
120
120
|
A,
|
|
121
121
|
{
|
|
122
122
|
maxAssets: l,
|
|
123
|
-
tokensList:
|
|
124
|
-
balances:
|
|
123
|
+
tokensList: n,
|
|
124
|
+
balances: t.map((p) => ({ token: p })),
|
|
125
125
|
iconSize: r ? 20 : 24,
|
|
126
|
-
options: { mode:
|
|
126
|
+
options: { mode: a, ...s }
|
|
127
127
|
}
|
|
128
128
|
);
|
|
129
129
|
}
|
|
130
130
|
function ae(e) {
|
|
131
|
-
const { header: l, mobileTitle: o } =
|
|
131
|
+
const { header: l, mobileTitle: o } = d(
|
|
132
132
|
e,
|
|
133
133
|
"components.poolTable.pool"
|
|
134
134
|
);
|
|
@@ -150,7 +150,7 @@ function ae(e) {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
function de(e) {
|
|
153
|
-
const { header: l, mobileTitle: o } =
|
|
153
|
+
const { header: l, mobileTitle: o } = d(
|
|
154
154
|
e,
|
|
155
155
|
"components.poolTable.supply"
|
|
156
156
|
);
|
|
@@ -166,7 +166,7 @@ function de(e) {
|
|
|
166
166
|
};
|
|
167
167
|
}
|
|
168
168
|
function se(e) {
|
|
169
|
-
const { header: l, headerTip: o, mobileTitle: t } =
|
|
169
|
+
const { header: l, headerTip: o, mobileTitle: t } = d(
|
|
170
170
|
e,
|
|
171
171
|
"components.poolTable.supplyApy",
|
|
172
172
|
"components.poolTable.supplyApy.tip"
|
|
@@ -178,24 +178,24 @@ function se(e) {
|
|
|
178
178
|
width: e?.width ?? "1.25fr",
|
|
179
179
|
align: "right",
|
|
180
180
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "apy", defaultDirection: "desc" },
|
|
181
|
-
cell: (
|
|
182
|
-
const { apy:
|
|
181
|
+
cell: (n) => {
|
|
182
|
+
const { apy: r, loading: a, points: s, tokensList: p } = n, {
|
|
183
183
|
totalAPY: T = 0,
|
|
184
184
|
baseAPY: b = [],
|
|
185
185
|
extraAPY: w = [],
|
|
186
186
|
externalAPY: y,
|
|
187
187
|
apy7DAgo: k
|
|
188
|
-
} =
|
|
189
|
-
return /* @__PURE__ */ i(u, { width: 60, loading: !!
|
|
188
|
+
} = r ?? {};
|
|
189
|
+
return /* @__PURE__ */ i(u, { width: 60, loading: !!a, children: /* @__PURE__ */ i(
|
|
190
190
|
C,
|
|
191
191
|
{
|
|
192
192
|
totalAPY: T,
|
|
193
|
-
totalAPYLoading: !!
|
|
193
|
+
totalAPYLoading: !!a,
|
|
194
194
|
baseAPY: b,
|
|
195
195
|
extraAPY: w,
|
|
196
|
-
points:
|
|
196
|
+
points: s,
|
|
197
197
|
apy7DAgo: k,
|
|
198
|
-
tokensList:
|
|
198
|
+
tokensList: p,
|
|
199
199
|
externalAPY: y
|
|
200
200
|
}
|
|
201
201
|
) });
|
|
@@ -204,7 +204,7 @@ function se(e) {
|
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
function ce(e) {
|
|
207
|
-
const { header: l, mobileTitle: o } =
|
|
207
|
+
const { header: l, mobileTitle: o } = d(
|
|
208
208
|
e,
|
|
209
209
|
"components.poolTable.borrowed"
|
|
210
210
|
);
|
|
@@ -218,7 +218,7 @@ function ce(e) {
|
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
function me(e) {
|
|
221
|
-
const { header: l, headerTip: o, mobileTitle: t } =
|
|
221
|
+
const { header: l, headerTip: o, mobileTitle: t } = d(
|
|
222
222
|
e,
|
|
223
223
|
"components.poolTable.borrowApy"
|
|
224
224
|
);
|
|
@@ -228,15 +228,15 @@ function me(e) {
|
|
|
228
228
|
headerTip: o,
|
|
229
229
|
width: e?.width ?? "150px",
|
|
230
230
|
align: "right",
|
|
231
|
-
cell: (
|
|
232
|
-
const
|
|
233
|
-
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: I(
|
|
231
|
+
cell: (n) => {
|
|
232
|
+
const r = n.pool.borrowAPY ?? e?.getBorrowRate?.(n.pool) ?? 0;
|
|
233
|
+
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: I(r) });
|
|
234
234
|
},
|
|
235
235
|
mobileTitle: t
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
function ue(e) {
|
|
239
|
-
const { header: l, mobileTitle: o } =
|
|
239
|
+
const { header: l, mobileTitle: o } = d(
|
|
240
240
|
e,
|
|
241
241
|
"components.poolTable.utilization"
|
|
242
242
|
);
|
|
@@ -248,14 +248,14 @@ function ue(e) {
|
|
|
248
248
|
className: "pr-4",
|
|
249
249
|
sort: e?.sortField !== void 0 ? { field: e.sortField, defaultDirection: "desc" } : { field: "utilization", defaultDirection: "desc" },
|
|
250
250
|
cell: (t) => {
|
|
251
|
-
const
|
|
252
|
-
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: /* @__PURE__ */ i(x, { percent:
|
|
251
|
+
const n = t.pool.utilization ?? 0;
|
|
252
|
+
return /* @__PURE__ */ i("div", { className: "flex justify-start md:justify-end", children: /* @__PURE__ */ i(x, { percent: n }) });
|
|
253
253
|
},
|
|
254
254
|
mobileTitle: o
|
|
255
255
|
};
|
|
256
256
|
}
|
|
257
257
|
function pe(e) {
|
|
258
|
-
const l = e?.maxAssets ?? 5, o = (
|
|
258
|
+
const l = e?.maxAssets ?? 5, o = (r) => O(r, l, e?.options), { header: t, mobileTitle: n } = d(
|
|
259
259
|
e,
|
|
260
260
|
"components.poolTable.collateral"
|
|
261
261
|
);
|
|
@@ -267,11 +267,11 @@ function pe(e) {
|
|
|
267
267
|
gapBefore: e?.gapBefore ?? "md",
|
|
268
268
|
cell: e?.cell ?? o,
|
|
269
269
|
mobileCell: e?.mobileCell ?? e?.cell ?? o,
|
|
270
|
-
mobileTitle:
|
|
270
|
+
mobileTitle: n
|
|
271
271
|
};
|
|
272
272
|
}
|
|
273
273
|
function fe(e) {
|
|
274
|
-
const { header: l, mobileTitle: o } =
|
|
274
|
+
const { header: l, mobileTitle: o } = d(
|
|
275
275
|
e,
|
|
276
276
|
"components.poolTable.balance"
|
|
277
277
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MultiAssetCellProps } from '../../assets-list-cell';
|
|
1
2
|
import { LocaleKeys } from '../../../locale';
|
|
2
3
|
import { PoolDTO, PoolTableCellContext, PoolTableColumnDef } from './types';
|
|
3
4
|
import type * as React from "react";
|
|
@@ -78,6 +79,7 @@ export declare function collateralColumn<P extends PoolDTO = PoolDTO>(options?:
|
|
|
78
79
|
align?: "left" | "right";
|
|
79
80
|
/** @default 5 */
|
|
80
81
|
maxAssets?: number;
|
|
82
|
+
options?: MultiAssetCellProps["options"];
|
|
81
83
|
}): PoolTableColumnDef<P>;
|
|
82
84
|
/**
|
|
83
85
|
* User balance column (client-v3 style) — USD + amount in pool token.
|
|
@@ -54,11 +54,11 @@ export interface PoolApyDTO {
|
|
|
54
54
|
loading7DAgo?: boolean;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
export interface PoolTableCellContext<P extends PoolDTO = PoolDTO> {
|
|
57
|
+
export interface PoolTableCellContext<P extends PoolDTO = PoolDTO, T extends TokenMetaInfo = TokenMetaInfo> {
|
|
58
58
|
pool: P;
|
|
59
|
-
tokensList: Record<Address,
|
|
59
|
+
tokensList: Record<Address, T> | undefined;
|
|
60
60
|
/** Underlying token meta (resolved from `pool.underlyingToken`). */
|
|
61
|
-
underlyingToken:
|
|
61
|
+
underlyingToken: T | undefined;
|
|
62
62
|
apy: PoolApyDTO | undefined;
|
|
63
63
|
/** Points / rewards data for tooltip. */
|
|
64
64
|
points: Array<PoolAPYPointsTip> | undefined;
|