-
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
29be256
commit 9e8982d
Showing
5 changed files
with
75 additions
and
2 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,33 @@ | ||
import { getQuestionsByCategoryId } from "@/lib/data"; | ||
import { Table, Heading } from "@radix-ui/themes"; | ||
import Link from "next/link"; | ||
|
||
export default async function Page({ params }: { params: { id: string } }) { | ||
const questions = await getQuestionsByCategoryId(Number(params.id)); | ||
|
||
return ( | ||
<div className="bg-sky-200 p-4 rounded-xl"> | ||
<Heading>Questions</Heading> | ||
<Link href="/dashboard">back</Link> | ||
<Table.Root> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.ColumnHeaderCell>id</Table.ColumnHeaderCell> | ||
<Table.ColumnHeaderCell>title</Table.ColumnHeaderCell> | ||
<Table.ColumnHeaderCell>content</Table.ColumnHeaderCell> | ||
</Table.Row> | ||
</Table.Header> | ||
|
||
<Table.Body> | ||
{questions.map((question) => ( | ||
<Table.Row key={question.id}> | ||
<Table.RowHeaderCell>{question.id}</Table.RowHeaderCell> | ||
<Table.Cell>{question.title}</Table.Cell> | ||
<Table.Cell>{question.content}</Table.Cell> | ||
</Table.Row> | ||
))} | ||
</Table.Body> | ||
</Table.Root> | ||
</div> | ||
); | ||
} |
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,33 @@ | ||
import { getQuestionsByCategoryId } from "@/lib/data"; | ||
import { Table, Heading } from "@radix-ui/themes"; | ||
import Link from "next/link"; | ||
|
||
export default async function Page() { | ||
const questions = await getQuestionsByCategoryId(1); | ||
|
||
return ( | ||
<div className="bg-sky-200 p-4 rounded-xl"> | ||
<Heading>Questions</Heading> | ||
<Link href="/dashboard">back</Link> | ||
<Table.Root> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.ColumnHeaderCell>id</Table.ColumnHeaderCell> | ||
<Table.ColumnHeaderCell>title</Table.ColumnHeaderCell> | ||
<Table.ColumnHeaderCell>content</Table.ColumnHeaderCell> | ||
</Table.Row> | ||
</Table.Header> | ||
|
||
<Table.Body> | ||
{questions.map((question) => ( | ||
<Table.Row key={question.id}> | ||
<Table.RowHeaderCell>{question.id}</Table.RowHeaderCell> | ||
<Table.Cell>{question.title}</Table.Cell> | ||
<Table.Cell>{question.content}</Table.Cell> | ||
</Table.Row> | ||
))} | ||
</Table.Body> | ||
</Table.Root> | ||
</div> | ||
); | ||
} |
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