Skip to content

Commit d4864f5

Browse files
committed
chore: add name to the permissions table
1 parent 27210a0 commit d4864f5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/components/Permissions/PermissionsTable.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { PermissionAPIResponse } from "@flanksource-ui/api/types/permissions";
22
import { Avatar } from "@flanksource-ui/ui/Avatar";
33
import { Badge } from "@flanksource-ui/ui/Badge/Badge";
4+
import { Icon } from "@flanksource-ui/ui/Icons/Icon";
45
import { MRTDateCell } from "@flanksource-ui/ui/MRTDataTable/Cells/MRTDateCells";
56
import MRTDataTable from "@flanksource-ui/ui/MRTDataTable/MRTDataTable";
67
import { MRT_ColumnDef } from "mantine-react-table";
@@ -42,6 +43,34 @@ const permissionsTableColumns: MRT_ColumnDef<PermissionAPIResponse>[] = [
4243
);
4344
}
4445
},
46+
{
47+
header: "Subject",
48+
size: 250,
49+
Cell: ({ row }) => {
50+
const team = row.original.team;
51+
const person = row.original.person;
52+
53+
if (person) {
54+
return (
55+
<div className="flex flex-row items-center gap-2">
56+
<Avatar user={person} />
57+
<span>{person.name}</span>
58+
</div>
59+
);
60+
}
61+
62+
if (team) {
63+
return (
64+
<div className="flex flex-row items-center gap-2">
65+
<Icon name={team.icon} className="h-5 w-5 text-gray-600" />
66+
<span>{team.name}</span>
67+
</div>
68+
);
69+
}
70+
71+
return null;
72+
}
73+
},
4574
{
4675
id: "action",
4776
header: "Action",

0 commit comments

Comments
 (0)