1+ "use client" ;
12import {
23 ExternalLinkIcon ,
34 GlobeIcon ,
@@ -8,6 +9,7 @@ import Link from "next/link";
89import { useMemo } from "react" ;
910import { type ThirdwebContract , ZERO_ADDRESS } from "thirdweb" ;
1011import type { ChainMetadata } from "thirdweb/chains" ;
12+ import { useActiveAccount } from "thirdweb/react" ;
1113import { Img } from "@/components/blocks/Img" ;
1214import { Button } from "@/components/ui/button" ;
1315import { CopyAddressButton } from "@/components/ui/CopyAddressButton" ;
@@ -64,6 +66,7 @@ export function ContractHeaderUI(props: {
6466
6567 return socialUrlsValue ;
6668 } , [ props . socialUrls ] ) ;
69+ const activeAccount = useActiveAccount ( ) ;
6770
6871 const cleanedChainName = props . chainMetadata ?. name
6972 ?. replace ( "Mainnet" , "" )
@@ -169,29 +172,32 @@ export function ContractHeaderUI(props: {
169172 variant = "outline"
170173 />
171174
172- < ToolTipLabel
173- contentClassName = "max-w-[300px]"
174- label = {
175- < >
176- View this contract in thirdweb dashboard to view contract
177- management interface
178- </ >
179- }
180- >
181- < Button
182- asChild
183- className = "rounded-full bg-card gap-1.5 text-xs py-1.5 px-2.5 h-auto"
184- size = "sm"
185- variant = "outline"
175+ { props . contractCreator ?. toLowerCase ( ) ===
176+ activeAccount ?. address ?. toLowerCase ( ) && (
177+ < ToolTipLabel
178+ contentClassName = "max-w-[300px]"
179+ label = {
180+ < >
181+ View this contract in thirdweb dashboard to view contract
182+ management interface
183+ </ >
184+ }
186185 >
187- < Link
188- href = { `/team/~/~/contract/${ props . chainMetadata . slug } /${ props . clientContract . address } ` }
186+ < Button
187+ asChild
188+ className = "rounded-full bg-card gap-1.5 text-xs py-1.5 px-2.5 h-auto"
189+ size = "sm"
190+ variant = "outline"
189191 >
190- < Settings2Icon className = "size-3.5 text-muted-foreground" />
191- Manage Contract
192- </ Link >
193- </ Button >
194- </ ToolTipLabel >
192+ < Link
193+ href = { `/team/~/~/contract/${ props . chainMetadata . slug } /${ props . clientContract . address } ` }
194+ >
195+ < Settings2Icon className = "size-3.5 text-muted-foreground" />
196+ Manage Contract
197+ </ Link >
198+ </ Button >
199+ </ ToolTipLabel >
200+ ) }
195201
196202 { validBlockExplorer && (
197203 < BadgeLink
0 commit comments