Extract component

This commit is contained in:
Willian Mitsuda 2022-03-02 06:35:05 -03:00
parent 6a4cff5883
commit ddfd0fb935
1 changed files with 15 additions and 12 deletions

View File

@ -91,20 +91,10 @@ const DecoratedAddressLink: React.FC<DecoratedAddressLinkProps> = ({
dontOverrideColors={mint || burn}
/>
{eoa === true && (
<span
className="text-xs text-gray-400 text-opacity-70 not-italic"
title="Externally owned account"
>
(EOA)
</span>
<AddressLegend title="Externally owned account">(EOA)</AddressLegend>
)}
{eoa === false && (
<span
className="text-xs text-gray-400 text-opacity-70 not-italic"
title="Contract account"
>
(C)
</span>
<AddressLegend title="Contract account">(C)</AddressLegend>
)}
</div>
);
@ -156,4 +146,17 @@ const ResolvedAddress: React.FC<ResolvedAddressProps> = ({
);
};
type AddressLegendProps = {
title: string;
};
const AddressLegend: React.FC<AddressLegendProps> = ({ title, children }) => (
<span
className="text-xs text-gray-400 text-opacity-70 not-italic"
title={title}
>
{children}
</span>
);
export default React.memo(DecoratedAddressLink);