mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
|
|
import type { ValidatorsZilliqaItem } from 'types/api/validators';
|
|
|
|
import config from 'configs/app';
|
|
import { TableBody, TableColumnHeader, TableHeaderSticky, TableRoot, TableRow } from '@luxfi/ui/table';
|
|
|
|
import ValidatorsTableItem from './ValidatorsTableItem';
|
|
|
|
interface Props {
|
|
data: Array<ValidatorsZilliqaItem>;
|
|
isLoading?: boolean;
|
|
top?: number;
|
|
}
|
|
|
|
const ValidatorsTable = ({ data, isLoading, top }: Props) => {
|
|
return (
|
|
<TableRoot>
|
|
<TableHeaderSticky top={ top }>
|
|
<TableRow>
|
|
<TableColumnHeader width="50%">BLS public key</TableColumnHeader>
|
|
<TableColumnHeader width="15%">Index</TableColumnHeader>
|
|
<TableColumnHeader width="35%" isNumeric>
|
|
Staked { config.chain.currency.symbol }
|
|
</TableColumnHeader>
|
|
</TableRow>
|
|
</TableHeaderSticky>
|
|
<TableBody>
|
|
{ data.map((item, index) => (
|
|
<ValidatorsTableItem
|
|
key={ item.bls_public_key + (isLoading ? index : '') }
|
|
data={ item }
|
|
isLoading={ isLoading }/>
|
|
)) }
|
|
</TableBody>
|
|
</TableRoot>
|
|
);
|
|
};
|
|
|
|
export default React.memo(ValidatorsTable);
|