import React, { useContext, useMemo } from "react"; import { BlockTag } from "@ethersproject/abstract-provider"; import ContentFrame from "../ContentFrame"; import PageControl from "../search/PageControl"; import ResultHeader from "../search/ResultHeader"; import PendingResults from "../search/PendingResults"; import TransactionItem from "../search/TransactionItem"; import { useFeeToggler } from "../search/useFeeToggler"; import { RuntimeContext } from "../useRuntime"; import { SelectionContext, useSelection } from "../useSelection"; import { ProcessedTransaction } from "../types"; import { PAGE_SIZE } from "../params"; import { useMultipleETHUSDOracle } from "../usePriceOracle"; type BlockTransactionResultsProps = { blockTag: BlockTag; page?: ProcessedTransaction[]; total: number; pageNumber: number; }; const BlockTransactionResults: React.FC = ({ blockTag, page, total, pageNumber, }) => { const { provider } = useContext(RuntimeContext); const selectionCtx = useSelection(); const [feeDisplay, feeDisplayToggler] = useFeeToggler(); const blockTags = useMemo(() => [blockTag], [blockTag]); const priceMap = useMultipleETHUSDOracle(provider, blockTags); return (
{page === undefined ? ( <>Waiting for search results... ) : ( <>A total of {total} transactions found )}
{page ? ( {page.map((tx) => ( ))}
A total of {total} transactions found
) : ( )}
); }; export default React.memo(BlockTransactionResults);