Skip to content

Commit

Permalink
Remove duplicate address links
Browse files Browse the repository at this point in the history
  • Loading branch information
LL782 committed Oct 15, 2024
1 parent 531f9ec commit cb9f97e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions developer-preview/src/app/ContractInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
import { UI } from "~/ui/UI";
import { type Deploymnent, type PreviewData } from "~/types/PreviewData";
import { type PreviewData } from "~/types/PreviewData";
import { formatShortAddress } from "~/app/formatShortAddress";

export const ContractInfo = ({ data }: { data: PreviewData }) => {
if (data.contract.deployments.length === 0) {
return <UI.FauxInput error>No deployments found</UI.FauxInput>;
}

const uniqueAddresses = Array.from(
new Set(data.contract.deployments.map(({ address }) => address)),
);

return (
<div>
<UI.FauxInput>
<div className="flex items-center justify-between">
<UI.InputText>{data.contract.name}</UI.InputText>

<div className="flex gap-5">
{data.contract.deployments.map(({ address }: Deploymnent) => (
{uniqueAddresses.map((address: string) => (
<UI.GreyLink
href={`https://etherscan.io/address/${address}`}
key={address}
Expand Down

0 comments on commit cb9f97e

Please sign in to comment.