import { Table, Tbody, Tr, Th } from '@chakra-ui/react'; import { AnimatePresence } from 'framer-motion'; import capitalize from 'lodash/capitalize'; import React from 'react'; import type { Block } from 'types/api/block'; import config from 'configs/app'; import { AddressHighlightProvider } from 'lib/contexts/addressHighlight'; import getNetworkValidatorTitle from 'lib/networks/getNetworkValidatorTitle'; import { currencyUnits } from 'lib/units'; import BlocksTableItem from 'ui/blocks/BlocksTableItem'; import * as SocketNewItemsNotice from 'ui/shared/SocketNewItemsNotice'; import { default as Thead } from 'ui/shared/TheadSticky'; interface Props { data: Array; isLoading?: boolean; top: number; page: number; socketInfoNum?: number; socketInfoAlert?: string; showSocketInfo?: boolean; } const VALIDATOR_COL_WEIGHT = 23; const GAS_COL_WEIGHT = 33; const REWARD_COL_WEIGHT = 22; const FEES_COL_WEIGHT = 22; const isRollup = config.features.rollup.isEnabled; const BlocksTable = ({ data, isLoading, top, page, showSocketInfo, socketInfoNum, socketInfoAlert }: Props) => { const widthBase = (!config.UI.views.block.hiddenFields?.miner ? VALIDATOR_COL_WEIGHT : 0) + GAS_COL_WEIGHT + (!isRollup && !config.UI.views.block.hiddenFields?.total_reward ? REWARD_COL_WEIGHT : 0) + (!isRollup && !config.UI.views.block.hiddenFields?.burnt_fees ? FEES_COL_WEIGHT : 0); return ( { !config.UI.views.block.hiddenFields?.miner && } { !isRollup && !config.UI.views.block.hiddenFields?.total_reward && } { !isRollup && !config.UI.views.block.hiddenFields?.burnt_fees && } { showSocketInfo && ( ) } { data.map((item, index) => ( )) }
Block Size, bytes{ capitalize(getNetworkValidatorTitle()) }Txn Gas usedReward { currencyUnits.ether }Burnt fees { currencyUnits.ether }
); }; export default BlocksTable;