feat(problemset): display sequential index instead of database id

This commit is contained in:
cfngc4594 2025-03-22 12:30:04 +08:00
parent e5ba5dd51a
commit 107f5d6670

View File

@ -49,7 +49,7 @@ export default async function ProblemsetPage() {
</TableHeader> </TableHeader>
<tbody aria-hidden="true" className="table-row h-2"></tbody> <tbody aria-hidden="true" className="table-row h-2"></tbody>
<TableBody className="[&_td:first-child]:rounded-l-lg [&_td:last-child]:rounded-r-lg"> <TableBody className="[&_td:first-child]:rounded-l-lg [&_td:last-child]:rounded-r-lg">
{problems.map((problem) => ( {problems.map((problem, index) => (
<TableRow <TableRow
key={problem.id} key={problem.id}
className="odd:bg-muted/50 odd:hover:bg-muted/50 border-none hover:bg-transparent" className="odd:bg-muted/50 odd:hover:bg-muted/50 border-none hover:bg-transparent"
@ -59,7 +59,7 @@ export default async function ProblemsetPage() {
href={`/problems/${problem.id}`} href={`/problems/${problem.id}`}
className="hover:text-blue-500" className="hover:text-blue-500"
> >
{problem.id} {index + 1}
</Link> </Link>
</TableCell> </TableCell>
<TableCell className="py-2.5"> <TableCell className="py-2.5">