otterscan/src/components/InternalTransactionOperation.tsx

29 lines
1005 B
TypeScript
Raw Normal View History

2021-07-21 19:06:51 +00:00
import React from "react";
import InternalTransfer from "./InternalTransfer";
import InternalSelfDestruct from "./InternalSelfDestruct";
import InternalCreate from "./InternalCreate";
import { TransactionData, InternalOperation, OperationType } from "../types";
type InternalTransactionOperationProps = {
txData: TransactionData;
internalOp: InternalOperation;
};
const InternalTransactionOperation: React.FC<InternalTransactionOperationProps> =
({ txData, internalOp }) => (
2021-07-21 19:06:51 +00:00
<>
{internalOp.type === OperationType.TRANSFER && (
<InternalTransfer txData={txData} internalOp={internalOp} />
2021-07-21 19:06:51 +00:00
)}
{internalOp.type === OperationType.SELF_DESTRUCT && (
<InternalSelfDestruct txData={txData} internalOp={internalOp} />
2021-07-21 19:06:51 +00:00
)}
{(internalOp.type === OperationType.CREATE ||
internalOp.type === OperationType.CREATE2) && (
<InternalCreate internalOp={internalOp} />
2021-07-21 19:06:51 +00:00
)}
</>
);
export default React.memo(InternalTransactionOperation);