feat(problemset): add clickable links for problem IDs and titles

This commit is contained in:
cfngc4594 2025-03-07 16:26:00 +08:00
parent 134046ff5a
commit 9a04d83f9e

View File

@ -1,3 +1,4 @@
import Link from "next/link";
import {
Table,
TableBody,
@ -29,9 +30,25 @@ export default async function ProblemsetPage() {
key={problem.id}
className="odd:bg-muted/50 odd:hover:bg-muted/50 border-none hover:bg-transparent"
>
<TableCell className="py-2.5">{problem.id}</TableCell>
<TableCell className="py-2.5">{problem.title}</TableCell>
<TableCell className="py-2.5">{problem.difficulty}</TableCell>
<TableCell className="py-2.5">
<Link
href={`/problems/${problem.id}`}
className="hover:text-blue-500"
>
{problem.id}
</Link>
</TableCell>
<TableCell className="py-2.5">
<Link
href={`/problems/${problem.id}`}
className="hover:text-blue-500"
>
{problem.title}
</Link>
</TableCell>
<TableCell className="py-2.5">
{problem.difficulty}
</TableCell>
</TableRow>
))}
</TableBody>