mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { Box } from '@chakra-ui/react';
|
|
import React from 'react';
|
|
|
|
import type { TxStateChange } from 'types/api/txStateChanges';
|
|
|
|
import { TableCell, TableRow } from 'toolkit/chakra/table';
|
|
import AddressEntity from 'ui/shared/entities/address/AddressEntity';
|
|
|
|
import { getStateElements } from './utils';
|
|
|
|
interface Props {
|
|
data: TxStateChange;
|
|
isLoading?: boolean;
|
|
}
|
|
|
|
const TxStateTableItem = ({ data, isLoading }: Props) => {
|
|
const { before, after, change, tag, tokenId } = getStateElements(data, isLoading);
|
|
|
|
return (
|
|
<TableRow>
|
|
<TableCell>
|
|
<Box py="3px">
|
|
{ tag }
|
|
</Box>
|
|
</TableCell>
|
|
<TableCell>
|
|
<AddressEntity
|
|
address={ data.address }
|
|
isLoading={ isLoading }
|
|
truncation="constant"
|
|
my="7px"
|
|
w="100%"
|
|
/>
|
|
</TableCell>
|
|
<TableCell isNumeric><Box py="7px">{ before }</Box></TableCell>
|
|
<TableCell isNumeric><Box py="7px">{ after }</Box></TableCell>
|
|
<TableCell isNumeric><Box py="7px">{ change }</Box></TableCell>
|
|
<TableCell>{ tokenId }</TableCell>
|
|
</TableRow>
|
|
);
|
|
};
|
|
|
|
export default React.memo(TxStateTableItem);
|