Files
explore/ui/tx/internals/TxInternalsTable.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

58 lines
1.9 KiB
TypeScript

import React from 'react';
import type { InternalTransaction } from 'types/api/internalTransaction';
import { AddressHighlightProvider } from 'lib/contexts/addressHighlight';
import { currencyUnits } from 'lib/units';
import { TableBody, TableColumnHeader, TableColumnHeaderSortable, TableHeaderSticky, TableRoot, TableRow } from 'toolkit/chakra/table';
import TxInternalsTableItem from 'ui/tx/internals/TxInternalsTableItem';
import type { Sort, SortField } from 'ui/tx/internals/utils';
interface Props {
data: Array<InternalTransaction>;
sort: Sort;
onSortToggle: (field: SortField) => void;
top: number;
isLoading?: boolean;
}
const TxInternalsTable = ({ data, sort, onSortToggle, top, isLoading }: Props) => {
return (
<AddressHighlightProvider>
<TableRoot>
<TableHeaderSticky top={ top }>
<TableRow>
<TableColumnHeader width="28%">Type</TableColumnHeader>
<TableColumnHeader width="40%">From/To</TableColumnHeader>
<TableColumnHeaderSortable
width="16%"
isNumeric
sortField="value"
sortValue={ sort }
onSortToggle={ onSortToggle }
>
Value { currencyUnits.ether }
</TableColumnHeaderSortable>
<TableColumnHeaderSortable
width="16%"
isNumeric
sortField="gas-limit"
sortValue={ sort }
onSortToggle={ onSortToggle }
>
Gas limit
</TableColumnHeaderSortable>
</TableRow>
</TableHeaderSticky>
<TableBody>
{ data.map((item, index) => (
<TxInternalsTableItem key={ item.index.toString() + (isLoading ? index : '') } { ...item } isLoading={ isLoading }/>
)) }
</TableBody>
</TableRoot>
</AddressHighlightProvider>
);
};
export default TxInternalsTable;