- {articles.slice(0, 2).map((article) =>
)}
+
+ {articles.slice(0, 3).map((article) => )}
);
}
-function AllArticlesSection({
- featuredArticles,
- regularArticles,
-}: {
- featuredArticles: Article[];
- regularArticles: Article[];
-}) {
- if (regularArticles.length === 0 && featuredArticles.length === 0) {
+function AllArticlesSection({ articles }: { articles: Article[] }) {
+ if (articles.length === 0) {
return (
No articles yet. Check back soon!
@@ -88,15 +78,11 @@ function AllArticlesSection({
);
}
- if (regularArticles.length === 0) {
- return null;
- }
-
return (
-
-
- {regularArticles.map((article) =>
)}
+
+
+ {articles.map((article) =>
)}
);
@@ -153,47 +139,25 @@ function FeaturedCard({ article }: { article: Article }) {
);
}
-function ArticleCard({ article }: { article: Article }) {
- const [coverImageError, setCoverImageError] = useState(false);
- const [coverImageLoaded, setCoverImageLoaded] = useState(false);
- const hasCoverImage = !coverImageError;
+function ArticleListItem({ article }: { article: Article }) {
const displayDate = article.updated || article.created;
return (
-
-
- {hasCoverImage && (
- setCoverImageLoaded(true)}
- onError={() => setCoverImageError(true)}
- loading="lazy"
- />
- )}
-
-
-
+
+
+
+
{article.title}
-
-
-
- {article.summary}
-
-
-
-
-
-
- Read →
-
-
+
+
by {article.author}
+
+
@@ -220,7 +184,7 @@ function ArticleImage({
}
return (
-