@@ -150,6 +150,141 @@ function Home() {
150150 const renderResults = ( ) => {
151151 // Case 1: We have data to show
152152 if ( data && data . length > 0 ) {
153+ // Check if any of the results have an exact name match with the search term
154+ const hasExactMatch = data . some ( profile => profile . name ?. toLowerCase ( ) === debouncedSearchTerm . toLowerCase ( ) ) ;
155+
156+ // If no exact match and it's a valid ENS name/address, try direct lookup alongside results
157+ if ( ! hasExactMatch && shouldAttemptDirectLookup ( debouncedSearchTerm ) ) {
158+ return (
159+ < >
160+ < div className = "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 p-1 relative" >
161+ { data . map ( ( profile , index ) => (
162+ < div key = { profile . name + index } className = "bg-white rounded-lg overflow-hidden shadow-sm hover:shadow-md transition-all duration-200" >
163+ < Link
164+ to = "/$profileId"
165+ params = { { profileId : getProfileId ( profile ) } }
166+ className = "block h-full"
167+ >
168+ < div className = "relative" >
169+ { /* Header/Banner image */ }
170+ { profile . header || profile . records ?. header ? (
171+ < div className = "w-full aspect-[3/1] overflow-hidden" >
172+ < img
173+ src = { profile . header || profile . records ?. header }
174+ alt = { `${ profile . display } banner` }
175+ className = "w-full h-full object-cover"
176+ />
177+ </ div >
178+ ) : (
179+ < div className = "w-full aspect-[3/1] bg-gradient-to-r from-blue-500 to-purple-600" > </ div >
180+ ) }
181+
182+ { /* Profile information with avatar */ }
183+ < div className = "p-2" >
184+ < div className = "flex items-start space-x-2 pb-3" >
185+ { /* Avatar */ }
186+ < div className = { `${ profile . header || profile . records ?. header ? '-mt-7' : '' } flex-shrink-0` } >
187+ { getProfilePicture ( profile ) ? (
188+ < img
189+ src = { getProfilePicture ( profile ) }
190+ alt = { profile . display }
191+ className = "h-14 w-14 rounded-full border-2 border-white shadow-md object-cover"
192+ />
193+ ) : (
194+ < div className = "h-14 w-14 rounded-full bg-gray-200 flex items-center justify-center text-gray-500 text-xl font-bold" >
195+ { profile . display . charAt ( 0 ) . toUpperCase ( ) }
196+ </ div >
197+ ) }
198+ </ div >
199+
200+ { /* Profile details */ }
201+ < div className = "flex-1 min-w-0" >
202+ < h3 className = "text-base font-semibold text-blue-600 truncate" >
203+ { profile . display }
204+ </ h3 >
205+ < p className = "text-xs text-gray-500 truncate" >
206+ { profile . address }
207+ </ p >
208+ < p className = "mt-1 text-xs text-gray-600 whitespace-pre-line line-clamp-2" >
209+ { getDescription ( profile ) }
210+ </ p >
211+
212+ { /* Chain addresses */ }
213+ { profile . chains && Object . keys ( profile . chains ) . length > 0 && (
214+ < div className = "mt-1.5 flex flex-wrap gap-x-2 gap-y-1" >
215+ { Object . entries ( profile . chains ) . map ( ( [ chain , address ] ) => (
216+ < div key = { chain } className = "flex items-center text-xs text-gray-500" title = { `${ chain . toUpperCase ( ) } : ${ address } ` } >
217+ < ChainIcon
218+ chain = { chain }
219+ iconUrl = { getChainIconUrl ( chain ) }
220+ className = "mr-1"
221+ />
222+ < span className = "truncate max-w-[100px]" > { address } </ span >
223+ </ div >
224+ ) ) }
225+ </ div >
226+ ) }
227+
228+ { /* Profile metadata - making it more compact */ }
229+ < div className = "mt-1.5 flex flex-wrap gap-x-3 gap-y-1 text-xs text-gray-500" >
230+ { profile . records ?. location && (
231+ < div className = "flex items-center" >
232+ < LuMapPin className = "mr-1 h-4 w-4" />
233+ < span > { profile . records . location } </ span >
234+ </ div >
235+ ) }
236+ { profile . records ?. email && (
237+ < div className = "flex items-center" >
238+ < LuMail className = "mr-1 h-4 w-4" />
239+ < span > { profile . records . email } </ span >
240+ </ div >
241+ ) }
242+ { profile . records ?. url && (
243+ < div className = "flex items-center" >
244+ < LuGlobe className = "mr-1 h-4 w-4" />
245+ < span > { profile . records . url } </ span >
246+ </ div >
247+ ) }
248+ </ div >
249+
250+ { /* Social links */ }
251+ < div className = "mt-1.5 flex space-x-2" >
252+ { profile . records ?. [ 'com.twitter' ] && (
253+ < div className = "text-blue-400 hover:text-blue-600" >
254+ < LuTwitter className = "h-4 w-4" title = { `Twitter: ${ profile . records [ 'com.twitter' ] } ` } />
255+ </ div >
256+ ) }
257+ { profile . records ?. [ 'com.github' ] && (
258+ < div className = "text-gray-700 hover:text-gray-900" >
259+ < LuGithub className = "h-4 w-4" title = { `GitHub: ${ profile . records [ 'com.github' ] } ` } />
260+ </ div >
261+ ) }
262+ { profile . records ?. [ 'com.discord' ] && (
263+ < div className = "text-indigo-500 hover:text-indigo-700" >
264+ < LuMessageSquare className = "h-4 w-4" title = { `Discord: ${ profile . records [ 'com.discord' ] } ` } />
265+ </ div >
266+ ) }
267+ { profile . records ?. [ 'org.telegram' ] && (
268+ < div className = "text-blue-500 hover:text-blue-700" >
269+ < LuSend className = "h-4 w-4" title = { `Telegram: ${ profile . records [ 'org.telegram' ] } ` } />
270+ </ div >
271+ ) }
272+ </ div >
273+ </ div >
274+ </ div >
275+ </ div >
276+ </ div >
277+ </ Link >
278+ </ div >
279+ ) ) }
280+ </ div >
281+ < div className = "mt-8 border-t pt-6" >
282+ < ProfileFallback searchTerm = { debouncedSearchTerm } />
283+ </ div >
284+ </ >
285+ ) ;
286+ }
287+
153288 return (
154289 < div className = "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6 p-1 relative" >
155290 { data . map ( ( profile , index ) => (
0 commit comments