otterscan/src/components/InternalCreate.tsx

46 lines
1.4 KiB
TypeScript
Raw Normal View History

2021-07-21 19:06:51 +00:00
import React from "react";
2021-07-21 18:13:18 +00:00
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
2021-07-21 19:06:51 +00:00
import { faAngleRight } from "@fortawesome/free-solid-svg-icons";
2021-07-21 18:13:18 +00:00
import AddressHighlighter from "./AddressHighlighter";
import DecoratedAddressLink from "./DecoratedAddressLink";
2021-07-21 19:06:51 +00:00
import { TransactionData, InternalOperation } from "../types";
2021-07-21 18:13:18 +00:00
type InternalCreateProps = {
txData: TransactionData;
2021-07-21 19:06:51 +00:00
internalOp: InternalOperation;
2021-07-21 18:13:18 +00:00
};
const InternalCreate: React.FC<InternalCreateProps> = ({
txData,
2021-07-21 19:06:51 +00:00
internalOp,
2021-07-21 18:13:18 +00:00
}) => {
return (
<>
<div className="flex items-baseline space-x-1 text-xs">
<span className="text-gray-500">
<FontAwesomeIcon icon={faAngleRight} size="1x" /> CREATE
</span>
<span>Contract</span>
<div className="flex items-baseline">
2021-07-21 19:06:51 +00:00
<AddressHighlighter address={internalOp.to}>
<DecoratedAddressLink address={internalOp.to} creation />
2021-07-21 18:13:18 +00:00
</AddressHighlighter>
</div>
<span className="flex items-baseline text-gray-400">
(Creator:{" "}
2021-07-21 19:06:51 +00:00
<AddressHighlighter address={internalOp.from}>
2021-07-21 18:13:18 +00:00
<DecoratedAddressLink
2021-07-21 19:06:51 +00:00
address={internalOp.from}
txFrom={internalOp.from === txData.from}
txTo={internalOp.from === txData.to}
2021-07-21 18:13:18 +00:00
/>
</AddressHighlighter>
)
</span>
</div>
</>
);
};
export default React.memo(InternalCreate);