import ArticleCard from './ArticleCard';
import styles from './ArticleGrid.module.css';

export default function ArticleGrid({ articles }) {
  if (!articles.length) {
    return <p className={styles.empty}>还没有文章，去写第一篇吧 ✦</p>;
  }

  return (
    <div className={styles.grid}>
      {articles.map((article, i) => (
        <ArticleCard key={article.id} article={article} index={i} />
      ))}
    </div>
  );
}
