mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* add address highlight provider to the transaction page * add address highlight provider to lists * fix tests
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import React from 'react';
|
|
|
|
import type { ClustersDirectoryObject } from 'types/api/clusters';
|
|
|
|
import { AddressHighlightProvider } from 'lib/contexts/addressHighlight';
|
|
import { TableBody, TableHeaderSticky, TableRow, TableColumnHeader, TableRoot } from 'toolkit/chakra/table';
|
|
import TimeFormatToggle from 'ui/shared/time/TimeFormatToggle';
|
|
|
|
import ClustersDirectoryTableItem from './ClustersDirectoryTableItem';
|
|
|
|
interface Props {
|
|
data: Array<ClustersDirectoryObject>;
|
|
isLoading?: boolean;
|
|
top?: number;
|
|
isClusterDetailsLoading?: boolean;
|
|
}
|
|
|
|
const ClustersDirectoryTable = ({ data, isLoading, top, isClusterDetailsLoading }: Props) => {
|
|
return (
|
|
<AddressHighlightProvider>
|
|
<TableRoot>
|
|
<TableHeaderSticky top={ top }>
|
|
<TableRow>
|
|
<TableColumnHeader width="40%">Cluster name</TableColumnHeader>
|
|
<TableColumnHeader width="40%">Address</TableColumnHeader>
|
|
<TableColumnHeader width="180px">
|
|
Joined
|
|
<TimeFormatToggle/>
|
|
</TableColumnHeader>
|
|
<TableColumnHeader width="20%">Active chains</TableColumnHeader>
|
|
</TableRow>
|
|
</TableHeaderSticky>
|
|
<TableBody>
|
|
{ data.map((item, index) => (
|
|
<ClustersDirectoryTableItem
|
|
key={ `${ item.name }-${ index }${ isLoading ? '-loading' : '' }` }
|
|
item={ item }
|
|
isLoading={ isLoading }
|
|
isClusterDetailsLoading={ isClusterDetailsLoading }
|
|
/>
|
|
)) }
|
|
</TableBody>
|
|
</TableRoot>
|
|
</AddressHighlightProvider>
|
|
);
|
|
};
|
|
|
|
export default React.memo(ClustersDirectoryTable);
|