11import React , { useState , useEffect } from 'react' ;
22import { motion } from 'framer-motion' ;
3- import { Copy , Check , Share2 } from 'lucide-react' ;
3+ import { Copy , Check , Share2 , Pencil } from 'lucide-react' ;
44import showToast from '@/utils/toast.util' ;
55import appendUtmParams from '@/utils/utm.utils' ;
66import { copyTextToClipboard } from '@/utils/clipboard.utils' ;
@@ -12,6 +12,7 @@ import CreatorBio from '@/components/common/CreatorBio';
1212import { formatCreatorHandle } from '@/utils/handleDisplay.utils' ;
1313import { normalizeCreatorDisplayName } from '@/utils/creatorDisplayName.utils' ;
1414import { CREATOR_CARD_MEDIA_RADIUS_CLASS } from '@/utils/creatorCardTokens' ;
15+ import { isOwnWallet } from '@/utils/isOwnWallet' ;
1516
1617interface CreatorProfileHeaderProps {
1718 name : string ;
@@ -21,6 +22,7 @@ interface CreatorProfileHeaderProps {
2122 isVerified ?: boolean ;
2223 bio ?: string | null ;
2324 className ?: string ;
25+ connectedWalletAddress ?: string | null ;
2426}
2527
2628const CREATOR_PROFILE_SUBTITLE_WRAP_CLASS_NAME =
@@ -34,6 +36,7 @@ const CreatorProfileHeader: React.FC<CreatorProfileHeaderProps> = ({
3436 isVerified,
3537 bio,
3638 className,
39+ connectedWalletAddress,
3740} ) => {
3841 const [ copied , setCopied ] = useState ( false ) ;
3942 const [ isScrolled , setIsScrolled ] = useState ( false ) ;
@@ -50,6 +53,10 @@ const CreatorProfileHeader: React.FC<CreatorProfileHeaderProps> = ({
5053 // URL construction the caller might do via the prop.
5154 const displayHandle = formatCreatorHandle ( handle ) ;
5255 const displayName = normalizeCreatorDisplayName ( name ) || 'Unnamed creator' ;
56+ const normalizedCreatorId =
57+ creatorId == null ? creatorId : String ( creatorId ) ;
58+
59+ const own = isOwnWallet ( connectedWalletAddress , normalizedCreatorId ) ;
5360
5461 const handleShare = async ( ) => {
5562 let url = window . location . href ;
@@ -163,13 +170,41 @@ const CreatorProfileHeader: React.FC<CreatorProfileHeaderProps> = ({
163170 </ div >
164171 </ div >
165172
166- < div
167- className = { cn (
168- 'flex items-center gap-3 transition-transform duration-300' ,
169- isScrolled ? 'scale-90' : 'scale-100'
170- ) }
171- >
172- < Button
173+ < div
174+ className = { cn (
175+ 'flex items-center gap-3 transition-transform duration-300' ,
176+ isScrolled ? 'scale-90' : 'scale-100'
177+ ) }
178+ >
179+ { own && (
180+ < >
181+ < Button
182+ aria-label = "Edit bio"
183+ variant = "outline"
184+ className = { cn (
185+ 'rounded-xl border-white/10 bg-white/5 font-bold text-white transition-all hover:border-amber-500/30 hover:bg-amber-500/10 active:scale-95' ,
186+ isScrolled ? 'h-9 px-3 text-xs' : 'h-11 px-4 text-sm'
187+ ) }
188+ >
189+ < Pencil className = "mr-2 size-4 text-amber-500" />
190+ < span className = "hidden sm:inline" > Edit Bio</ span >
191+ < span className = "sm:hidden" > Edit</ span >
192+ </ Button >
193+ < Button
194+ aria-label = "Change avatar"
195+ variant = "outline"
196+ className = { cn (
197+ 'rounded-xl border-white/10 bg-white/5 font-bold text-white transition-all hover:border-amber-500/30 hover:bg-amber-500/10 active:scale-95' ,
198+ isScrolled ? 'h-9 px-3 text-xs' : 'h-11 px-4 text-sm'
199+ ) }
200+ >
201+ < Pencil className = "mr-2 size-4 text-amber-500" />
202+ < span className = "hidden sm:inline" > Change Avatar</ span >
203+ < span className = "sm:hidden" > Avatar</ span >
204+ </ Button >
205+ </ >
206+ ) }
207+ < Button
173208 onClick = { handleShare }
174209 variant = "outline"
175210 className = { cn (
0 commit comments