import type { Article } from '@/types/nostr' import { AuthorCard } from './AuthorCard' import { t } from '@/lib/i18n' interface AuthorsListProps { authors: Article[] allAuthors: Article[] loading: boolean error: string | null } function LoadingState(): JSX.Element { return (

{t('common.loading.authors')}

) } function ErrorState({ message }: { message: string }): JSX.Element { return (

{message}

) } function EmptyState({ hasAny }: { hasAny: boolean }): JSX.Element { return (

{hasAny ? t('common.empty.authors.filtered') : t('common.empty.authors')}

) } export function AuthorsList({ authors, allAuthors, loading, error }: AuthorsListProps): JSX.Element { if (loading) { return } if (error) { return } if (authors.length === 0) { return 0} /> } return ( <>
Showing {authors.length} of {allAuthors.length} author{allAuthors.length !== 1 ? 's' : ''}
{authors.map((author) => ( ))}
) }