@@ -131,16 +131,6 @@ function Home() {
131131 e . preventDefault ( ) ;
132132 } ;
133133
134- // Helper function to get the best profile picture URL
135- const getProfilePicture = ( profile : any ) => {
136- return profile . avatar || profile . records ?. avatar || null ;
137- } ;
138-
139- // Helper function to get the best profile description
140- const getDescription = ( profile : any ) => {
141- return profile . records ?. description || '' ;
142- } ;
143-
144134 // Render search results or appropriate message
145135 const renderResults = ( ) => {
146136 // Case 1: We have data to show
@@ -181,9 +171,9 @@ function Home() {
181171 < div className = "flex items-start space-x-2 pb-3" >
182172 { /* Avatar */ }
183173 < div className = { `${ profile . header || profile . records ?. header ? '-mt-7' : '' } flex-shrink-0` } >
184- { getProfilePicture ( profile ) ? (
174+ { profile . avatar ? (
185175 < img
186- src = { getProfilePicture ( profile ) }
176+ src = { profile . avatar }
187177 alt = { profile . display }
188178 className = "h-14 w-14 rounded-full border-2 border-white shadow-md object-cover"
189179 />
@@ -203,7 +193,7 @@ function Home() {
203193 { profile . address }
204194 </ p >
205195 < p className = "mt-1 text-xs text-gray-600 whitespace-pre-line line-clamp-2" >
206- { getDescription ( profile ) }
196+ { profile . records ?. description || '' }
207197 </ p >
208198
209199 { /* Chain addresses */ }
@@ -311,9 +301,9 @@ function Home() {
311301 < div className = "flex items-start space-x-2 pb-3" >
312302 { /* Avatar */ }
313303 < div className = { `${ profile . header || profile . records ?. header ? '-mt-7' : '' } flex-shrink-0` } >
314- { getProfilePicture ( profile ) ? (
304+ { profile . avatar ? (
315305 < img
316- src = { getProfilePicture ( profile ) }
306+ src = { profile . avatar }
317307 alt = { profile . display }
318308 className = "h-14 w-14 rounded-full border-2 border-white shadow-md object-cover"
319309 />
@@ -333,7 +323,7 @@ function Home() {
333323 { profile . address }
334324 </ p >
335325 < p className = "mt-1 text-xs text-gray-600 whitespace-pre-line line-clamp-2" >
336- { getDescription ( profile ) }
326+ { profile . records ?. description || '' }
337327 </ p >
338328
339329 { /* Chain addresses */ }
0 commit comments