mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* new ENV and page placeholder * display list data * comment out SearchInput * add counters * add tag to address page * tests * refactoring * fix ts * change ENVs for demo * fix ENVs validator * [skip ci] remove hash * review fixes
45 lines
1.4 KiB
TypeScript
45 lines
1.4 KiB
TypeScript
import { Skeleton } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import type { Validator } from 'types/api/validators';
|
|
|
|
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
|
|
import ListItemMobileGrid from 'ui/shared/ListItemMobile/ListItemMobileGrid';
|
|
import ValidatorStatus from 'ui/shared/statusTag/ValidatorStatus';
|
|
|
|
interface Props {
|
|
data: Validator;
|
|
isLoading?: boolean;
|
|
}
|
|
|
|
const ValidatorsListItem = ({ data, isLoading }: Props) => {
|
|
|
|
return (
|
|
<ListItemMobileGrid.Container>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Address</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<AddressEntity
|
|
isLoading={ isLoading }
|
|
address={ data.address }
|
|
truncation="constant"
|
|
/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Status</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<ValidatorStatus state={ data.state } isLoading={ isLoading }/>
|
|
</ListItemMobileGrid.Value>
|
|
|
|
<ListItemMobileGrid.Label isLoading={ isLoading }>Blocks</ListItemMobileGrid.Label>
|
|
<ListItemMobileGrid.Value>
|
|
<Skeleton isLoaded={ !isLoading } display="inline-block">
|
|
{ data.blocks_validated_count.toLocaleString() }
|
|
</Skeleton>
|
|
</ListItemMobileGrid.Value>
|
|
</ListItemMobileGrid.Container>
|
|
);
|
|
};
|
|
|
|
export default React.memo(ValidatorsListItem);
|