@@ -2,14 +2,14 @@ import { FC } from 'react'
22import { useTranslation } from 'react-i18next'
33import Typography from '@mui/material/Typography'
44import { RoflInstance } from '../../../oasis-nexus/api'
5+ import { SearchScope } from '../../../types/searchScope'
56import { COLORS } from '../../../styles/theme/colors'
7+ import { useScreenSize } from '../../hooks/useScreensize'
8+ import { trimLongString } from '../../utils/trimLongString'
69import { Table , TableCellAlign , TableColProps } from '../../components/Table'
710import { TablePaginationProps } from '../../components/Table/TablePagination'
8- import { RoflAppInstanceStatusBadge } from 'app/components/Rofl/RoflAppInstanceStatusBadge'
9- import { RouteUtils } from 'app/utils/route-utils'
10- import { Link as RouterLink } from 'react-router-dom'
11- import Link from '@mui/material/Link'
12- import { SearchScope } from '../../../types/searchScope'
11+ import { RoflAppInstanceStatusBadge } from '../../components/Rofl/RoflAppInstanceStatusBadge'
12+ import { RoflAppInstanceLink } from '../../components/Rofl/RoflAppInstanceLink'
1313
1414type InstancesListProps = {
1515 currentEpoch : number | undefined
@@ -31,37 +31,35 @@ export const InstancesList: FC<InstancesListProps> = ({
3131 scope,
3232} ) => {
3333 const { t } = useTranslation ( )
34+ const { isTablet } = useScreenSize ( )
35+
3436 const tableColumns : TableColProps [ ] = [
3537 { key : 'rak' , content : t ( 'rofl.rakAbbreviation' ) } ,
3638 { key : 'node' , content : t ( 'rofl.nodeId' ) } ,
3739 { key : 'expirationEpoch' , content : t ( 'rofl.expirationEpoch' ) , align : TableCellAlign . Right } ,
3840 { key : 'expirationStatus' , content : t ( 'common.status' ) , align : TableCellAlign . Right } ,
3941 ]
40-
4142 const tableRows =
4243 currentEpoch !== undefined && instances
4344 ? instances ?. map ( instance => {
4445 const isActive = instance . expiration_epoch > currentEpoch
45- const to = RouteUtils . getRoflAppInstanceRoute ( scope . network , appId , instance . rak )
4646
4747 return {
4848 key : instance . rak ,
4949 backgroundColor : isActive ? 'transparent' : COLORS . grayLight ,
5050 data : [
5151 {
5252 key : 'rak' ,
53+ content : < RoflAppInstanceLink id = { appId } network = { scope . network } rak = { instance . rak } /> ,
54+ } ,
55+ {
56+ key : 'node' ,
5357 content : (
5458 < Typography variant = "mono" >
55- < Link component = { RouterLink } to = { to } >
56- { instance . rak }
57- </ Link >
59+ { isTablet ? trimLongString ( instance . endorsing_node_id ) : instance . endorsing_node_id }
5860 </ Typography >
5961 ) ,
6062 } ,
61- {
62- key : 'node' ,
63- content : < Typography variant = "mono" > { instance . endorsing_node_id } </ Typography > ,
64- } ,
6563 {
6664 key : 'expirationEpoch' ,
6765 content : instance . expiration_epoch . toLocaleString ( ) ,
0 commit comments