import type { Article } from '@/types/nostr' import { ArticleCard } from './ArticleCard' import { ErrorState, EmptyState, Skeleton } from './ui' import { t } from '@/lib/i18n' interface ArticlesListProps { articles: Article[] allArticles: Article[] loading: boolean error: string | null onUnlock: (article: Article) => void unlockedArticles: Set } function ArticleCardSkeleton(): React.ReactElement { return (
) } function LoadingState(): React.ReactElement { return (
{Array.from({ length: 3 }).map((_, index) => ( ))}
) } function ArticlesEmptyState({ hasAny }: { hasAny: boolean }): React.ReactElement { return ( ) } export function ArticlesList({ articles, allArticles, loading, error, onUnlock, unlockedArticles, }: ArticlesListProps): React.ReactElement { if (loading) { return } if (error) { return } if (articles.length === 0) { return 0} /> } return ( <>
Showing {articles.length} of {allArticles.length} article{allArticles.length !== 1 ? 's' : ''}
{articles.map((article) => ( ))}
) }