File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
src/components/Permissions Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { PermissionAPIResponse } from "@flanksource-ui/api/types/permissions" ;
2
2
import { Avatar } from "@flanksource-ui/ui/Avatar" ;
3
3
import { Badge } from "@flanksource-ui/ui/Badge/Badge" ;
4
+ import { Icon } from "@flanksource-ui/ui/Icons/Icon" ;
4
5
import { MRTDateCell } from "@flanksource-ui/ui/MRTDataTable/Cells/MRTDateCells" ;
5
6
import MRTDataTable from "@flanksource-ui/ui/MRTDataTable/MRTDataTable" ;
6
7
import { MRT_ColumnDef } from "mantine-react-table" ;
@@ -42,6 +43,34 @@ const permissionsTableColumns: MRT_ColumnDef<PermissionAPIResponse>[] = [
42
43
) ;
43
44
}
44
45
} ,
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
+ } ,
45
74
{
46
75
id : "action" ,
47
76
header : "Action" ,
You can’t perform that action at this time.
0 commit comments