1
1
import { useMemo , useState } from 'react' ;
2
2
import Link from 'next/link' ;
3
3
import { motion } from 'framer-motion' ;
4
- import { cl , isZero , toNormalizedBN , truncateHex } from '@builtbymom/web3/utils' ;
4
+ import { cl , formatPercent , isZero , toNormalizedBN , truncateHex } from '@builtbymom/web3/utils' ;
5
5
import { getChainBgColor } from '@vaults-v3/utils' ;
6
6
import { IconLinkOut } from '@yearn-finance/web-lib/icons/IconLinkOut' ;
7
+ import { formatDuration } from '@yearn-finance/web-lib/utils/format.time' ;
7
8
import { getNetwork } from '@yearn-finance/web-lib/utils/wagmi/utils' ;
8
9
import { ImageWithFallback } from '@common/components/ImageWithFallback' ;
9
10
import { RenderAmount } from '@common/components/RenderAmount' ;
@@ -12,7 +13,7 @@ import {useYearn} from '@common/contexts/useYearn';
12
13
import { VaultChainTag } from '../VaultChainTag' ;
13
14
14
15
import type { ReactElement } from 'react' ;
15
- import type { TYDaemonVault } from '@yearn-finance/web-lib/utils/schemas/yDaemonVaultsSchemas' ;
16
+ import type { TYDaemonVault , TYDaemonVaultStrategy } from '@yearn-finance/web-lib/utils/schemas/yDaemonVaultsSchemas' ;
16
17
import type { TNormalizedBN } from '@builtbymom/web3/types' ;
17
18
18
19
export function VaultStakedAmount ( { currentVault} : { currentVault : TYDaemonVault } ) : ReactElement {
@@ -70,7 +71,7 @@ export function VaultsV3ListStrategy({
70
71
currentVault,
71
72
allocationPercentage
72
73
} : {
73
- currentVault : TYDaemonVault ;
74
+ currentVault : TYDaemonVault & { details : TYDaemonVaultStrategy [ 'details' ] } ;
74
75
allocationPercentage : number ;
75
76
} ) : ReactElement {
76
77
const [ isExpanded , set_isExpanded ] = useState ( false ) ;
@@ -108,6 +109,9 @@ export function VaultsV3ListStrategy({
108
109
} ;
109
110
110
111
const chainBgColor = getChainBgColor ( currentVault . chainID ) ;
112
+ const lastReportTime = currentVault . details ?. lastReport
113
+ ? formatDuration ( currentVault . details . lastReport * 1000 - new Date ( ) . valueOf ( ) , true )
114
+ : 'N/A' ;
111
115
112
116
return (
113
117
< div
@@ -264,23 +268,17 @@ export function VaultsV3ListStrategy({
264
268
< div className = { 'flex flex-col gap-2' } >
265
269
< div className = { 'flex flex-row gap-2' } >
266
270
< span className = { '' } > { 'Management Fee:' } </ span >
267
- < span > { '0%' } </ span >
271
+ < span > { formatPercent ( ( currentVault . apr . fees . management || 0 ) * 100 , 0 ) } </ span >
268
272
</ div >
269
273
< div className = { 'flex flex-row gap-2' } >
270
274
< span className = { '' } > { 'Performance Fee:' } </ span >
271
- < span > { '5%' } </ span >
275
+ < span >
276
+ { formatPercent ( ( currentVault . details ?. performanceFee || 0 ) / 100 , 0 ) }
277
+ </ span >
272
278
</ div >
273
279
< div className = { 'flex flex-row gap-2' } >
274
280
< span className = { '' } > { 'Last Report:' } </ span >
275
- < Link
276
- href = { `#` }
277
- onClick = { ( event ) : void => event . stopPropagation ( ) }
278
- className = { 'flex items-center gap-1 text-white hover:opacity-60' }
279
- target = { '_blank' }
280
- rel = { 'noopener noreferrer' } >
281
- { '3 days ago' }
282
- < IconLinkOut className = { 'inline-block size-3' } />
283
- </ Link >
281
+ { lastReportTime }
284
282
</ div >
285
283
</ div >
286
284
</ div >
0 commit comments