Files
tom goriunovandGitHub 932add9d96 Change zero to <0.001 value within different pages (#3150)
* basic components and address page refactoring

* second part of refactoring

* third part of refactoring

* NativeCoinValue component

* more refactoring

* rename TruncatedValue into TruncatedText

* minor fixes

* refactor block details

* fix layout of value and fee in tx table

* update screenshots

* different units for tooltip and stats widget small value fix

* update screenshots

* update tx table screenshot

* fix copy button vertical alignment
2025-12-05 16:04:27 +01:00

56 lines
1.6 KiB
TypeScript

import { Flex } from '@chakra-ui/react';
import React from 'react';
import type { ValidatorBlackfort } from 'types/api/validators';
import { Skeleton } from 'toolkit/chakra/skeleton';
import { TableCell, TableRow } from 'toolkit/chakra/table';
import { TruncatedText } from 'toolkit/components/truncation/TruncatedText';
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
import NativeCoinValue from 'ui/shared/value/NativeCoinValue';
interface Props {
data: ValidatorBlackfort;
isLoading?: boolean;
}
const ValidatorsTableItem = ({ data, isLoading }: Props) => {
return (
<TableRow>
<TableCell verticalAlign="middle">
<AddressEntity
address={ data.address }
isLoading={ isLoading }
truncation="constant"
/>
</TableCell>
<TableCell verticalAlign="middle">
<Flex>
<TruncatedText text={ data.name } loading={ isLoading }/>
</Flex>
</TableCell>
<TableCell verticalAlign="middle" isNumeric>
<Skeleton loading={ isLoading }>
{ `${ data.commission / 100 }%` }
</Skeleton>
</TableCell>
<TableCell verticalAlign="middle" isNumeric>
<NativeCoinValue
amount={ data.self_bonded_amount }
loading={ isLoading }
noSymbol
/>
</TableCell>
<TableCell verticalAlign="middle" isNumeric>
<NativeCoinValue
amount={ data.delegated_amount }
loading={ isLoading }
noSymbol
/>
</TableCell>
</TableRow>
);
};
export default React.memo(ValidatorsTableItem);