Files

55 lines
1.5 KiB
TypeScript

import React from 'react';
import type { ValidatorBlackfort } from 'types/api/validators';
import { Skeleton } from '@luxfi/ui/skeleton';
import { TableCell, TableRow } from '@luxfi/ui/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">
<div className="flex">
<TruncatedText text={ data.name } loading={ isLoading }/>
</div>
</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);