-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
944eee5
commit 173bd49
Showing
7 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { QuestionCard } from "@/components/QuestionCard"; | ||
import { getCategoryById, getQuestionsByCategoryId } from "@/lib/data"; | ||
import React from "react"; | ||
|
||
export default async function CategoryDetail({ | ||
params, | ||
}: { | ||
params: { id: string }; | ||
}) { | ||
const category = await getCategoryById(Number(params.id)); | ||
const questions = await getQuestionsByCategoryId(Number(params.id)); | ||
|
||
return ( | ||
<main> | ||
<div className="px-4 md:px-8 py-4 bg-gray-100"> | ||
<h2 className="my-4 pl-3 text-xl font-bold border-l-4 border-green-300"> | ||
{category.name}の質問を探す | ||
</h2> | ||
<div className="grid xl:grid-cols-4 sm:grid-cols-2 gap-4 mx-auto"> | ||
{questions.map((item) => ( | ||
<QuestionCard | ||
key={item.id} | ||
id={item.id.toString()} | ||
title={item.title} | ||
content={item.content} | ||
/> | ||
))} | ||
</div> | ||
</div> | ||
</main> | ||
); | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters