+ {sortedAuthors.map(author => renderAuthorCard(author))}
-
-
- {sortedGroupKeys.map(letter => (
-
-
- {letter}
-
-
- {groupedAuthors![letter].map(author => (
- viewMode === 'grid' ? renderAuthorCard(author) : renderAuthorListItem(author)
- ))}
-
-
- ))}
+ ) : (
+
+ {sortedAuthors.map(author => renderAuthorListItem(author))}
- >
- )}
-
-
-
- {isLoading ? (
-
- {Array.from({ length: 4 }).map((_, i) => (
-
-
-
- {Array.from({ length: 3 }).map((_, j) => (
-
- ))}
-
-
- ))}
-
- ) : (
-
- {/* Group authors by century */}
- {Array.from(new Set(authors?.map(a => Math.floor((a.birthYear || 1800) / 100) * 100))).sort().map(century => {
- const centuryLabel = `${century}s`;
- const centuryAuthors = authors?.filter(a =>
- Math.floor((a.birthYear || 1800) / 100) * 100 === century
- );
-
- return (
-
-
- {centuryLabel}
-
-
- {centuryAuthors?.map(author => (
- viewMode === 'grid' ? renderAuthorCard(author) : renderAuthorListItem(author)
- ))}
-
-
- );
- })}
-
- )}
-
+ )}
+ >
+ )}
{/* Pagination */}
{totalPages > 1 && (