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 username in live submissions d…
Browse files Browse the repository at this point in the history
…ata-table

  ## what
  - display `username` in live submissions data-table

  ## how

  ## why

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

  ## usage
  • Loading branch information
Clumsy-Coder committed Jan 16, 2024
1 parent 00039e2 commit ed202c6
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 @@ -59,5 +59,21 @@ export const columns: ColumnDef<Submission>[] = [
);
},
},
{
accessorKey: "username",
accessorFn: row => `${row.msg.name} (${row.msg.uname})`,
header: ({ column }) => {
return (
<DataTableColumnHeader column={column} title="User (username)" />
);
},
cell: ({ row }) => {
return (
<Link href={`/users/${row.original.msg.uname}`} className={buttonVariants({variant: 'outline'})}>
{row.getValue("username")}
</Link>
);
},
},
]

0 comments on commit ed202c6

Please sign in to comment.