1
- import { useMemo , useState } from 'react' ;
1
+ import { ReactElement , useMemo , useState } from 'react' ;
2
2
3
3
import {
4
4
type ColumnDef ,
@@ -13,6 +13,7 @@ import { Flex, type HTMLStyledProps, styled } from 'leather-styles/jsx';
13
13
import { DummyIcon } from '~/components/dummy' ;
14
14
import { BitcoinIcon } from '~/components/icons/bitcoin-icon' ;
15
15
import { StacksIcon } from '~/components/icons/stacks-icon' ;
16
+ import { ImgFillLoader } from '~/components/img-loader' ;
16
17
import { SortableHeader , Table , theadBorderBottom } from '~/components/table' ;
17
18
18
19
import { Button , Flag } from '@leather.io/ui' ;
@@ -30,14 +31,44 @@ interface EarnProvider {
30
31
minAmount : string | null ;
31
32
estApr : string ;
32
33
payout : string ;
34
+ icon : ReactElement ;
33
35
}
34
36
const earnProviders : EarnProvider [ ] = [
35
- { provider : 'Fast Pool' , minAmount : null , estApr : '5%' , payout : 'STX' } ,
36
- { provider : 'PlanBetter' , minAmount : '200 STX' , estApr : '10%' , payout : 'STX' } ,
37
- { provider : 'Restake' , minAmount : '100 STX' , estApr : '11%' , payout : 'STX' } ,
38
- { provider : 'Xverse Pool' , minAmount : '100 STX' , estApr : '10%' , payout : 'BTC' } ,
39
- { provider : 'Stacking DAO' , minAmount : '100 STX' , estApr : '16%' , payout : 'STX' } ,
40
- { provider : 'Xverse' , minAmount : null , estApr : '10%' , payout : 'STX' } ,
37
+ {
38
+ provider : 'Fast Pool' ,
39
+ icon : < ImgFillLoader src = "icons/fastpool.webp" width = "24" fill = "black" /> ,
40
+ minAmount : null ,
41
+ estApr : '5%' ,
42
+ payout : 'STX' ,
43
+ } ,
44
+ {
45
+ provider : 'PlanBetter' ,
46
+ icon : < ImgFillLoader src = "icons/planbetter.webp" width = "24" fill = "black" /> ,
47
+ minAmount : '200 STX' ,
48
+ estApr : '10%' ,
49
+ payout : 'STX' ,
50
+ } ,
51
+ {
52
+ provider : 'Restake' ,
53
+ icon : < ImgFillLoader src = "icons/restake.webp" width = "24" fill = "#124044" /> ,
54
+ minAmount : '100 STX' ,
55
+ estApr : '11%' ,
56
+ payout : 'STX' ,
57
+ } ,
58
+ {
59
+ provider : 'Xverse Pool' ,
60
+ icon : < ImgFillLoader src = "icons/xverse.webp" width = "24" fill = "black" /> ,
61
+ minAmount : '100 STX' ,
62
+ estApr : '10%' ,
63
+ payout : 'BTC' ,
64
+ } ,
65
+ {
66
+ provider : 'Stacking DAO' ,
67
+ icon : < ImgFillLoader src = "icons/stacking-dao.webp" width = "24" fill = "#1C3830" /> ,
68
+ minAmount : '100 STX' ,
69
+ estApr : '16%' ,
70
+ payout : 'STX' ,
71
+ } ,
41
72
] ;
42
73
43
74
export function EarnProviderTable ( props : HTMLStyledProps < 'div' > ) {
@@ -47,7 +78,7 @@ export function EarnProviderTable(props: HTMLStyledProps<'div'>) {
47
78
{
48
79
accessorKey : 'provider' ,
49
80
cell : info => (
50
- < Flag img = { < DummyIcon /> } >
81
+ < Flag img = { info . row . original . icon } >
51
82
< styled . span color = "ink.text-primary" > { info . getValue ( ) as string } </ styled . span >
52
83
</ Flag >
53
84
) ,
@@ -165,10 +196,21 @@ interface LiquidStackingProvider {
165
196
provider : string ;
166
197
estApr : string ;
167
198
payout : string ;
199
+ icon : ReactElement ;
168
200
}
169
201
const liquidStackingProviders : LiquidStackingProvider [ ] = [
170
- { provider : 'StackingDAO' , estApr : '5%' , payout : 'stSTX' } ,
171
- { provider : 'LISA' , estApr : '10%' , payout : 'LiSTX' } ,
202
+ {
203
+ provider : 'StackingDAO' ,
204
+ estApr : '5%' ,
205
+ payout : 'stSTX' ,
206
+ icon : < ImgFillLoader src = "icons/stacking-dao.webp" width = "24" fill = "black" /> ,
207
+ } ,
208
+ {
209
+ provider : 'LISA' ,
210
+ estApr : '10%' ,
211
+ payout : 'LiSTX' ,
212
+ icon : < ImgFillLoader src = "icons/lisa.webp" width = "24" fill = "#FB9DF1" /> ,
213
+ } ,
172
214
] ;
173
215
174
216
export function LiquidStackingProviderTable ( props : HTMLStyledProps < 'div' > ) {
@@ -178,7 +220,7 @@ export function LiquidStackingProviderTable(props: HTMLStyledProps<'div'>) {
178
220
{
179
221
accessorKey : 'provider' ,
180
222
cell : info => (
181
- < Flag img = { < DummyIcon /> } >
223
+ < Flag img = { info . row . original . icon } >
182
224
< styled . span color = "ink.text-primary" > { info . getValue ( ) as string } </ styled . span >
183
225
</ Flag >
184
226
) ,
0 commit comments