mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* 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
54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
import { Flex } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import type { AddressEpochRewardsItem } from 'types/api/address';
|
|
|
|
import { route } from 'nextjs-routes';
|
|
|
|
import { Link } from 'toolkit/chakra/link';
|
|
import { TableCell, TableRow } from 'toolkit/chakra/table';
|
|
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
|
|
import EpochRewardTypeTag from 'ui/shared/EpochRewardTypeTag';
|
|
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
|
|
import TokenValue from 'ui/shared/value/TokenValue';
|
|
|
|
type Props = {
|
|
item: AddressEpochRewardsItem;
|
|
isLoading?: boolean;
|
|
};
|
|
|
|
const AddressEpochRewardsTableItem = ({ item, isLoading }: Props) => {
|
|
return (
|
|
<TableRow>
|
|
<TableCell verticalAlign="middle">
|
|
<Flex alignItems="center" gap={ 3 }>
|
|
<Link
|
|
href={ route({ pathname: '/epochs/[number]', query: { number: String(item.epoch_number) } }) }
|
|
loading={ isLoading }
|
|
>
|
|
{ item.epoch_number }
|
|
</Link>
|
|
<TimeWithTooltip timestamp={ item.block_timestamp } isLoading={ isLoading } color="text.secondary" fontWeight={ 400 }/>
|
|
</Flex>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<EpochRewardTypeTag type={ item.type } isLoading={ isLoading }/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<AddressEntity address={ item.associated_account } isLoading={ isLoading } truncation="constant"/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle" isNumeric>
|
|
<TokenValue
|
|
amount={ item.amount }
|
|
token={ item.token }
|
|
loading={ isLoading }
|
|
layout="vertical"
|
|
rowGap="10px"
|
|
/>
|
|
</TableCell>
|
|
</TableRow>
|
|
);
|
|
};
|
|
|
|
export default AddressEpochRewardsTableItem;
|