Files
explore/ui/epochs/EpochsTableItem.tsx
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

71 lines
2.2 KiB
TypeScript

import { HStack } from '@chakra-ui/react';
import React from 'react';
import type { CeloEpochListItem } from 'types/api/epochs';
import { Skeleton } from 'toolkit/chakra/skeleton';
import { TableCell, TableRow } from 'toolkit/chakra/table';
import EpochEntity from 'ui/shared/entities/epoch/EpochEntity';
import CeloEpochStatus from 'ui/shared/statusTag/CeloEpochStatus';
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
import NativeCoinValue from 'ui/shared/value/NativeCoinValue';
interface Props {
item: CeloEpochListItem;
isLoading?: boolean;
};
const EpochsTableItem = ({ item, isLoading }: Props) => {
return (
<TableRow>
<TableCell verticalAlign="middle">
<HStack gap={ 2 }>
<EpochEntity number={ String(item.number) } noIcon fontWeight={ 700 } isLoading={ isLoading }/>
<Skeleton loading={ isLoading } color="text.secondary" fontWeight={ 500 }><span>{ item.type }</span></Skeleton>
<TimeWithTooltip
timestamp={ item.timestamp }
isLoading={ isLoading }
color="text.secondary"
display="inline-block"
fontWeight={ 400 }
/>
</HStack>
</TableCell>
<TableCell verticalAlign="middle">
<CeloEpochStatus
isFinalized={ item.is_finalized }
loading={ isLoading }
/>
</TableCell>
<TableCell verticalAlign="middle">
<Skeleton loading={ isLoading }>
{ item.start_block_number } - { item.end_block_number || '' }
</Skeleton>
</TableCell>
<TableCell verticalAlign="middle" isNumeric>
<NativeCoinValue
amount={ item.distribution?.community_transfer?.value }
noSymbol
loading={ isLoading }
/>
</TableCell>
<TableCell verticalAlign="middle" isNumeric>
<NativeCoinValue
amount={ item.distribution?.carbon_offsetting_transfer?.value }
noSymbol
loading={ isLoading }
/>
</TableCell>
<TableCell verticalAlign="middle" isNumeric>
<NativeCoinValue
amount={ item.distribution?.transfers_total?.value }
noSymbol
loading={ isLoading }
/>
</TableCell>
</TableRow>
);
};
export default EpochsTableItem;