mirror of
https://github.com/luxfi/explore.git
synced 2026-10-30 14:46:12 +00:00
82 lines
2.8 KiB
TypeScript
82 lines
2.8 KiB
TypeScript
import React from 'react';
|
|
|
|
import type { ArbitrumL2TxnBatchesItem } from 'types/api/arbitrumL2';
|
|
|
|
import { route } from 'nextjs-routes';
|
|
|
|
import config from 'configs/app';
|
|
import { Link } from 'toolkit/next/link';
|
|
import { Skeleton } from '@luxfi/ui/skeleton';
|
|
import { TableCell, TableRow } from '@luxfi/ui/table';
|
|
import ArbitrumL2TxnBatchDA from 'ui/shared/batch/ArbitrumL2TxnBatchDA';
|
|
import BatchEntityL2 from 'ui/shared/entities/block/BatchEntityL2';
|
|
import BlockEntityL1 from 'ui/shared/entities/block/BlockEntityL1';
|
|
import TxEntityL1 from 'ui/shared/entities/tx/TxEntityL1';
|
|
import ArbitrumL2TxnBatchStatus from 'ui/shared/statusTag/ArbitrumL2TxnBatchStatus';
|
|
import TimeWithTooltip from 'ui/shared/time/TimeWithTooltip';
|
|
|
|
const rollupFeature = config.features.rollup;
|
|
|
|
type Props = { item: ArbitrumL2TxnBatchesItem; isLoading?: boolean };
|
|
|
|
const ArbitrumL2TxnBatchesTableItem = ({ item, isLoading }: Props) => {
|
|
if (!rollupFeature.isEnabled || rollupFeature.type !== 'arbitrum') {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<TableRow>
|
|
<TableCell verticalAlign="middle">
|
|
<BatchEntityL2
|
|
isLoading={ isLoading }
|
|
number={ item.number }
|
|
className="font-semibold"
|
|
noIcon
|
|
/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<div className="flex flex-row gap-1">
|
|
<ArbitrumL2TxnBatchStatus status={ item.commitment_transaction.status } isLoading={ isLoading }/>
|
|
<ArbitrumL2TxnBatchDA dataContainer={ item.batch_data_container } isLoading={ isLoading }/>
|
|
</div>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<BlockEntityL1
|
|
number={ item.commitment_transaction.block_number }
|
|
isLoading={ isLoading }
|
|
/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<Skeleton loading={ isLoading } display="inline-block">{ item.blocks_count ? item.blocks_count.toLocaleString() : 'N/A' }</Skeleton>
|
|
</TableCell>
|
|
<TableCell pr={ 12 } verticalAlign="middle">
|
|
<TxEntityL1
|
|
hash={ item.commitment_transaction.hash }
|
|
isLoading={ isLoading }
|
|
truncation="constant_long"
|
|
noCopy
|
|
/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<TimeWithTooltip
|
|
timestamp={ item.commitment_transaction.timestamp }
|
|
fallbackText="Undefined"
|
|
isLoading={ isLoading }
|
|
color="text.secondary"
|
|
/>
|
|
</TableCell>
|
|
<TableCell verticalAlign="middle">
|
|
<Link
|
|
href={ route({ pathname: '/batches/[number]', query: { number: item.number.toString(), tab: 'txs' } }) }
|
|
loading={ isLoading }
|
|
className="min-w-[40px]"
|
|
>
|
|
{ item.transactions_count.toLocaleString() }
|
|
</Link>
|
|
</TableCell>
|
|
</TableRow>
|
|
);
|
|
};
|
|
|
|
export default ArbitrumL2TxnBatchesTableItem;
|