|
1 | 1 | "use client";
|
2 | 2 |
|
3 | 3 | import { Button } from "@/components/ui/button";
|
4 |
| -import { MoreHorizontal } from "lucide-react"; |
| 4 | +import { ArrowUpDown, MoreHorizontal } from "lucide-react"; |
5 | 5 | import {
|
6 | 6 | DropdownMenu,
|
7 | 7 | DropdownMenuContent,
|
@@ -38,23 +38,44 @@ export const contributorsColumns: ColumnDef<ContributorDto>[] = [
|
38 | 38 | },
|
39 | 39 | {
|
40 | 40 | accessorKey: "contributionScorePercentage",
|
41 |
| - header: () => <div className="text-center"> Impact </div>, |
| 41 | + header: ({ column }) => { |
| 42 | + return ( |
| 43 | + <Button |
| 44 | + variant="ghost" |
| 45 | + onClick={() => column.toggleSorting(column.getIsSorted() === "asc")} |
| 46 | + className="flex items-center" |
| 47 | + > |
| 48 | + Impact |
| 49 | + <ArrowUpDown className="ml-2 h-4 w-4" /> |
| 50 | + </Button> |
| 51 | + ); |
| 52 | + }, |
42 | 53 | cell: ({ row }) => {
|
43 | 54 | const contributor = row.original;
|
44 | 55 | return (
|
45 |
| - <div className="text-xl font-bold text-center"> |
| 56 | + <div className="text-xl font-bold text-left pl-4"> |
46 | 57 | {contributor.contributionScorePercentage.toFixed(2) + "%"}
|
47 | 58 | </div>
|
48 | 59 | );
|
49 | 60 | },
|
50 | 61 | },
|
51 | 62 | {
|
52 | 63 | accessorKey: "contributionScore",
|
53 |
| - header: () => <div className="text-center"> ContributionScore </div>, |
| 64 | + header: ({ column }) => { |
| 65 | + return ( |
| 66 | + <Button |
| 67 | + variant="ghost" |
| 68 | + onClick={() => column.toggleSorting(column.getIsSorted() === "asc")} |
| 69 | + > |
| 70 | + Contribution Score |
| 71 | + <ArrowUpDown className="ml-2 h-4 w-4 flex items-center" /> |
| 72 | + </Button> |
| 73 | + ); |
| 74 | + }, |
54 | 75 | cell: ({ row }) => {
|
55 | 76 | const contributor = row.original;
|
56 | 77 | return (
|
57 |
| - <div className="text-xl font-bold text-center"> |
| 78 | + <div className="text-xl font-bold text-left pl-14"> |
58 | 79 | {contributor.contributionScore.toFixed(2)}
|
59 | 80 | </div>
|
60 | 81 | );
|
|
0 commit comments