diff --git a/components/ArticleList.js b/components/ArticleList.js index e586b7ec..8291552e 100644 --- a/components/ArticleList.js +++ b/components/ArticleList.js @@ -2,37 +2,39 @@ import Link from '@/components/Link' import ArticleThumbnail from './ArticleThumbnail' const ArticleList = ({ slug, title, summary, tags, image }) => { + const visibleTags = (tags || []).slice(0, 3) + return (
- -
-
+ +
+
-
+
-
+
- {tags.slice(0, 3).map((tag) => ( + {visibleTags.map((tag) => ( {tag} ))}
-

+

{title}

-

+

{summary}

-
- Đọc thêm +
+ Đọc thêm {
-
+
) diff --git a/components/ArticleThumbnail.js b/components/ArticleThumbnail.js index 8d0d9e64..dd54c19a 100644 --- a/components/ArticleThumbnail.js +++ b/components/ArticleThumbnail.js @@ -1,12 +1,13 @@ -import Link from '@/components/Link' import Image from 'next/image' -const ArticleThumbnail = ({ slug, title, image }) => { +const ArticleThumbnail = ({ title, image }) => { + const thumbnail = image || '/static/images/default-ogp.png' + return ( {title} { const route = `/${router.pathname.split('/')[1]}` return ( -
-