Skip to content

Commit c9046cc

Browse files
committed
翻訳機能の実装完了!
1 parent 0e9bddb commit c9046cc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/app/article/components/list.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
"use client";
12
import { ReactNode } from "react";
2-
import { generateArticleButton, Article } from "../article";
3+
import { generateArticleButton, Article } from "../article-client";
4+
import { useLocale } from "@/app/i18nProvider";
35

46
interface ArticleListProps {
57
articles: Article[];
68
}
79

8-
export default async function ArticleList({ articles }: ArticleListProps) {
10+
export default function ArticleList({ articles }: ArticleListProps) {
11+
const locale = useLocale();
12+
const filteredArticles = articles.filter((a) => a.lang === locale);
913
return (
1014
<section className="articles">
11-
{articles.map(
15+
{filteredArticles.map(
1216
(article: Article): ReactNode => generateArticleButton(article)
1317
)}
1418
</section>

0 commit comments

Comments
 (0)