@@ -21,6 +21,7 @@ interface BuilderListProps {
2121 onLoadMoreError ?: string | null ;
2222 onClearLoadMoreError ?: ( ) => void ;
2323 onSearchNavigate ?: ( accountId : string ) => void ;
24+ sentinelRef ?: React . RefObject < HTMLDivElement | null > ;
2425}
2526
2627function BuilderListItemSkeleton ( { index } : { index : number } ) {
@@ -72,6 +73,7 @@ export function BuilderList({
7273 onLoadMoreError,
7374 onClearLoadMoreError,
7475 onSearchNavigate,
76+ sentinelRef,
7577} : BuilderListProps ) {
7678 const [ searchQuery , setSearchQuery ] = useState ( "" ) ;
7779 const totalCount = ( totalCounts ?. legion || 0 ) + ( totalCounts ?. initiate || 0 ) ;
@@ -202,24 +204,26 @@ export function BuilderList({
202204 </ button >
203205 </ div >
204206 ) : (
205- < button
206- type = "button"
207- onClick = { onLoadMore }
208- disabled = { isLoadingMore }
209- className = "w-full py-2.5 text-sm text-primary hover:bg-primary/10 font-mono font-medium border border-primary/30 transition-colors disabled:opacity-50"
210- >
207+ < div className = "text-center" >
211208 { isLoadingMore ? (
212- < span className = "flex items-center justify-center gap-2" >
209+ < div className = "flex items-center justify-center gap-2 py -2" >
213210 < span className = "size-4 border-2 border-primary/30 border-t-primary rounded-full animate-spin" />
214- Loading...
215- </ span >
211+ < span className = "text-sm text-muted-foreground font-mono" > Loading...</ span >
212+ </ div >
216213 ) : (
217- "Load more"
214+ < span className = "text-xs text-muted-foreground font-mono" >
215+ { builders . length } loaded • Scroll for more
216+ </ span >
218217 ) }
219- </ button >
218+ </ div >
220219 ) }
221220 </ div >
222221 ) }
222+
223+ { /* Sentinel element for infinite scroll intersection observer */ }
224+ { hasMore && ! searchQuery && (
225+ < div ref = { sentinelRef } className = "h-1" aria-hidden = "true" />
226+ ) }
223227 </ >
224228 ) }
225229 </ div >
0 commit comments