Files
explore/ui/nameServices/directories/ClustersDirectoryTableItem.tsx
0eadf590e7 Fixes for release v2.4.0 (#3079)
* fix links in approvals list

* pass check-summed hash to safe API call

* make tx hash optional for token transfers

* fix multiple public tag submission

* update screenshots

* use DataListDisplay for revoke

* force to send credential only with general API requests

* prefer formatted date label over date default formatting when saving chart data as csv

* add abort failed status for zeta chain CCTX

* update specify sdk

* rename ENV for native token address

* add ENV to hide native coin price in topbar

* rename routes for name services

* fix chart csv export file

* fix tests

---------

Co-authored-by: Max Alekseenko <[email protected]>
Co-authored-by: isstuev <[email protected]>
2025-10-29 15:54:06 +01:00

54 lines
1.8 KiB
TypeScript

import React from 'react';
import type { ClustersDirectoryObject } from 'types/api/clusters';
import { isEvmAddress } from 'lib/address/isEvmAddress';
import { Skeleton } from 'toolkit/chakra/skeleton';
import { TableCell, TableRow } from 'toolkit/chakra/table';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import ClustersEntity from 'ui/shared/entities/clusters/ClustersEntity';
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
interface Props {
item: ClustersDirectoryObject;
isLoading?: boolean;
isClusterDetailsLoading?: boolean;
}
const ClustersDirectoryTableItem = ({ item, isLoading, isClusterDetailsLoading }: Props) => {
return (
<TableRow>
<TableCell verticalAlign="middle">
<ClustersEntity clusterName={ item.name } isLoading={ isLoading } fontWeight={ 600 }/>
</TableCell>
<TableCell verticalAlign="middle">
{ item.owner && (
<AddressEntity
address={{ hash: item.owner }}
isLoading={ isLoading }
fontWeight={ 500 }
noLink={ !isEvmAddress(item.owner) }
w="fit-content"
maxW="100%"
/>
) }
{ !item.owner && <Skeleton loading={ isLoading }>—</Skeleton> }
</TableCell>
<TableCell verticalAlign="middle">
<TimeWithTooltip
timestamp={ item.createdAt }
isLoading={ isLoading }
enableIncrement={ true }
/>
</TableCell>
<TableCell verticalAlign="middle">
<Skeleton loading={ isLoading || isClusterDetailsLoading }>
{ (item.chainIds?.length || 1) } { (item.chainIds?.length || 1) === 1 ? 'chain' : 'chains' }
</Skeleton>
</TableCell>
</TableRow>
);
};
export default React.memo(ClustersDirectoryTableItem);