11import { FC } from 'react'
22import { useHref , useParams } from 'react-router-dom'
33import { useTranslation } from 'react-i18next'
4- import { formatDistanceStrict } from 'date-fns'
5- import Box from '@mui/material/Box'
64import Grid from '@mui/material/Grid'
75import Skeleton from '@mui/material/Skeleton'
86import Typography from '@mui/material/Typography'
@@ -21,16 +19,17 @@ import { RoflAppStatusBadge } from '../../components/Rofl/RoflAppStatusBadge'
2119import { RoflAppLink } from '../../components/Rofl/RoflAppLink'
2220import { AccountLink } from '../../components/Account/AccountLink'
2321import { CopyToClipboard } from '../../components/CopyToClipboard'
24- import { TransactionLink } from '../../components/Transactions/TransactionLink'
2522import { TeeType } from './TeeType'
2623import { Endorsement } from './Endorsement'
2724import { Enclaves } from './Enclaves'
2825import { Secrets } from './Secrets'
2926import { RouterTabs } from '../../components/RouterTabs'
27+ import { TableCellAge } from '../../components/TableCellAge'
3028import { instancesContainerId } from '../../utils/tabAnchors'
3129import { RoflAppDetailsContext } from '../RoflAppDetailsPage/hooks'
3230import { MetaDataCard } from './MetaDataCard'
3331import { PolicyCard } from './PolicyCard'
32+ import { LastActivity } from './LastActivity'
3433
3534export const RoflAppDetailsPage : FC = ( ) => {
3635 const { t } = useTranslation ( )
@@ -140,8 +139,12 @@ export const RoflAppDetailsView: FC<{
140139
141140 < dt > { t ( 'rofl.adminAccount' ) } </ dt >
142141 < dd >
143- < AccountLink scope = { { network : app . network , layer : app . layer } } address = { app . admin } />
144- < CopyToClipboard value = { app . admin } />
142+ < AccountLink
143+ scope = { { network : app . network , layer : app . layer } }
144+ address = { app . admin_eth ?? app . admin }
145+ alwaysTrimOnTablet
146+ />
147+ < CopyToClipboard value = { app . admin_eth ?? app . admin } />
145148 </ dd >
146149
147150 < dt > { t ( 'rofl.stakedAmount' ) } </ dt >
@@ -167,6 +170,8 @@ export const RoflAppDetailsView: FC<{
167170 < dd >
168171 < RoflAppLink id = { app . id } network = { app . network } withSourceIndicator = { false } />
169172 </ dd >
173+ < dt > { t ( 'rofl.instances' ) } </ dt >
174+ < dd > { app . num_active_instances . toLocaleString ( ) } </ dd >
170175 < dt > { t ( 'rofl.created' ) } </ dt >
171176 < dd >
172177 { t ( 'common.formattedDateTime' , {
@@ -181,32 +186,21 @@ export const RoflAppDetailsView: FC<{
181186 } ) }
182187 </ dd >
183188 < dt > { t ( 'rofl.lastActivity' ) } </ dt >
184- < dd > { t ( 'common.missing' ) } </ dd >
189+ < dd > { < TableCellAge sinceTimestamp = { app . last_activity } /> } </ dd >
185190 </ >
186191 ) }
187192
188193 { detailsPage && (
189194 < >
190195 < dt > { t ( 'rofl.lastActivity' ) } </ dt >
191196 < dd >
192- { app . last_activity_tx ? (
193- < Box sx = { { display : 'flex' , alignItems : 'center' , gap : 3 } } >
194- < TransactionLink
195- scope = { { network : app . network , layer : app . layer } }
196- hash = { app . last_activity_tx . eth_hash || app . last_activity_tx . hash }
197- />
198- (
199- { formatDistanceStrict ( app . last_activity_tx . timestamp , new Date ( ) , {
200- addSuffix : true ,
201- } ) }
202- )
203- </ Box >
204- ) : (
205- t ( 'common.missing' )
206- ) }
197+ < LastActivity
198+ scope = { { network : app . network , layer : app . layer } }
199+ transaction = { app . last_activity_tx }
200+ />
207201 </ dd >
208202
209- < dt > { t ( 'rofl.instances ' ) } </ dt >
203+ < dt > { t ( 'rofl.activeInstances ' ) } </ dt >
210204 < dd > { app . num_active_instances . toLocaleString ( ) } </ dd >
211205
212206 < dt > { t ( 'rofl.endorsement' ) } </ dt >
0 commit comments