Skip to content

Commit cff6bc9

Browse files
feat: add department column to policies table (#1499)
- Introduced a new column for 'Department' in the policies table, enhancing data representation. - Utilized the Badge component for improved visual styling of department names. This addition improves the clarity and usability of the policies table for users. Co-authored-by: Mariano Fuentes <marfuen98@gmail.com>
1 parent 943a7d3 commit cff6bc9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

apps/app/src/app/(app)/[orgId]/policies/all/components/policies-table-columns.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { DataTableColumnHeader } from '@/components/data-table/data-table-column-header';
44
import { StatusIndicator } from '@/components/status-indicator';
55
import { formatDate } from '@/lib/format';
6+
import { Badge } from '@comp/ui/badge';
67
import { Policy } from '@db';
78
import { ColumnDef } from '@tanstack/react-table';
89
import { ExternalLink } from 'lucide-react';
@@ -53,6 +54,23 @@ export function getPolicyColumns(orgId: string): ColumnDef<Policy>[] {
5354
variant: 'select',
5455
},
5556
},
57+
{
58+
id: 'department',
59+
accessorKey: 'department',
60+
header: ({ column }) => <DataTableColumnHeader column={column} title="Department" />,
61+
cell: ({ row }) => {
62+
return (
63+
<Badge variant="marketing" className="w-fit uppercase">
64+
{row.original.department}
65+
</Badge>
66+
);
67+
},
68+
meta: {
69+
label: 'Department',
70+
},
71+
enableColumnFilter: true,
72+
enableSorting: true,
73+
},
5674
{
5775
id: 'updatedAt',
5876
accessorKey: 'updatedAt',

0 commit comments

Comments
 (0)