import React, { useMemo, useContext } from "react"; import { Route, Switch, useParams } from "react-router-dom"; import StandardFrame from "./StandardFrame"; import StandardSubtitle from "./StandardSubtitle"; import Tab from "./components/Tab"; import Details from "./transaction/Details"; import Logs from "./transaction/Logs"; import { RuntimeContext } from "./useRuntime"; import { SelectionContext, useSelection } from "./useSelection"; import { useInternalOperations, useTxData } from "./useErigonHooks"; type TransactionParams = { txhash: string; }; const Transaction: React.FC = () => { const { provider } = useContext(RuntimeContext); const params = useParams(); const { txhash } = params; const txData = useTxData(provider, txhash); const internalOps = useInternalOperations(provider, txData); const sendsEthToMiner = useMemo(() => { if (!txData || !internalOps) { return false; } for (const t of internalOps) { if (t.to === txData.miner) { return true; } } return false; }, [txData, internalOps]); const selectionCtx = useSelection(); return ( Transaction Details {txData && (
Overview Logs{txData && ` (${txData.logs.length})`}
)} ); }; export default React.memo(Transaction);