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 11import { PermissionAPIResponse } from "@flanksource-ui/api/types/permissions" ;
22import { Avatar } from "@flanksource-ui/ui/Avatar" ;
33import { Badge } from "@flanksource-ui/ui/Badge/Badge" ;
4+ import { Icon } from "@flanksource-ui/ui/Icons/Icon" ;
45import { MRTDateCell } from "@flanksource-ui/ui/MRTDataTable/Cells/MRTDateCells" ;
56import MRTDataTable from "@flanksource-ui/ui/MRTDataTable/MRTDataTable" ;
67import { 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" ,
You can’t perform that action at this time.
0 commit comments