otterscan/src/components/InternalCreate.tsx

45 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";
import { faAngleRight } from "@fortawesome/free-solid-svg-icons/faAngleRight";
import TransactionAddress from "./TransactionAddress";
2021-07-21 18:13:18 +00:00
import AddressHighlighter from "./AddressHighlighter";
import DecoratedAddressLink from "./DecoratedAddressLink";
import { InternalOperation } from "../types";
import { ResolvedAddresses } from "../api/address-resolver";
2021-07-21 18:13:18 +00:00
type InternalCreateProps = {
2021-07-21 19:06:51 +00:00
internalOp: InternalOperation;
resolvedAddresses: ResolvedAddresses | undefined;
2021-07-21 18:13:18 +00:00
};
const InternalCreate: React.FC<InternalCreateProps> = ({
2021-07-21 19:06:51 +00:00
internalOp,
resolvedAddresses,
2021-11-18 18:51:08 +00:00
}) => (
<div className="flex items-baseline space-x-1 whitespace-nowrap">
<span className="text-gray-500">
<FontAwesomeIcon icon={faAngleRight} size="1x" /> CREATE
</span>
<span>Contract</span>
<div className="flex items-baseline">
<AddressHighlighter address={internalOp.to}>
<DecoratedAddressLink
address={internalOp.to}
creation
resolvedAddresses={resolvedAddresses}
/>
</AddressHighlighter>
</div>
<span className="flex items-baseline text-gray-400">
(Creator:{" "}
<TransactionAddress
address={internalOp.from}
resolvedAddresses={resolvedAddresses}
/>
2021-11-18 18:51:08 +00:00
)
</span>
</div>
);
2021-07-21 18:13:18 +00:00
2021-11-18 18:51:08 +00:00
export default InternalCreate;