Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
feat(components:data-table): display problem number in live submiss…
Browse files Browse the repository at this point in the history
…ions data-table

  ## what
  - display `problem number` in live submissions data-table

  ## how

  ## why

  ## where
  - ./src/app/components/data-table/columns.tsx

  ## usage
  • Loading branch information
Clumsy-Coder committed Jan 3, 2024
1 parent c70af14 commit 44f75d5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/app/components/data-table/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,21 @@ export const columns: ColumnDef<Submission>[] = [
);
},
},
{
accessorKey: "problemNum",
accessorFn: row => row.msg.pnum,
header: ({ column }) => {
return (
<DataTableColumnHeader column={column} title="Problem number" />
);
},
cell: ({ row }) => {
return (
<Link href={`/problems/${row.getValue("problemNum")}`} className={buttonVariants({variant: 'outline'})}>
{row.getValue("problemNum")}
</Link>
);
},
},
]

0 comments on commit 44f75d5

Please sign in to comment.