diff --git a/packages/website/components/ArticleList/index.tsx b/packages/website/components/ArticleList/index.tsx index 1ce7d5cfc..fe05aec82 100644 --- a/packages/website/components/ArticleList/index.tsx +++ b/packages/website/components/ArticleList/index.tsx @@ -1,36 +1,34 @@ -import { Article } from "../../types/article"; import dayjs from "dayjs"; import Link from "next/link"; + import { getTarget } from "../Link/tools"; +import { type Article } from "../../types/article"; import { getArticlePath } from "../../utils/getArticlePath"; -export default function (props: { + +export default (props: { articles: Article[]; showYear?: boolean; openArticleLinksInNewWindow: boolean; onClick?: () => void; -}) { - return ( -
- {props.articles.map((article, index) => { - return ( - -
-
- {props.showYear - ? dayjs(article.createdAt).format("YYYY-MM-DD") - : dayjs(article.createdAt).format("MM-DD")} -
-
- {article.title} -
-
- - ); - })} -
- ); -} +}) => ( +
+ {props.articles.map((article) => ( + +
+
+ {dayjs(article.createdAt).format( + props.showYear ? "YYYY-MM-DD" : "MM-DD" + )} +
+
+ {article.title} +
+
+ + ))} +
+);