11import * as React from 'react' ;
22
3- import { EmptyState , EmptyStateBody , PageSection } from '@patternfly/react-core' ;
3+ import { EmptyState , EmptyStateBody } from '@patternfly/react-core' ;
44import { CubesIcon } from '@patternfly/react-icons' ;
55import { Table , Tbody , Td , Th , Thead , Tr } from '@patternfly/react-table' ;
66
77import { ResourceAllowDeny } from '../../models/AppProjectModel' ;
88import { useGitOpsTranslation } from '../../utils/hooks/useGitOpsTranslation' ;
99
10+ import './ResourceAllowDenyList.scss' ;
11+
1012interface ResourceAllowDenyListProps {
1113 list ?: ResourceAllowDeny [ ] ;
1214}
@@ -17,30 +19,36 @@ const ResourceAllowDenyList: React.FC<ResourceAllowDenyListProps> = ({ list }) =
1719 const resourceList = list || [ ] ;
1820
1921 return (
20- < PageSection >
22+ < >
2123 { resourceList . length > 0 ? (
22- < Table aria-label = "Resource Allow/Deny table" borders >
23- < Thead >
24- < Tr >
25- < Th > { t ( 'Kind' ) } </ Th >
26- < Th > { t ( 'Group' ) } </ Th >
27- </ Tr >
28- </ Thead >
29- < Tbody >
30- { resourceList . map ( ( resource , index ) => (
31- < Tr key = { index } >
32- < Td dataLabel = { t ( 'Kind' ) } > { resource . kind || '-' } </ Td >
33- < Td dataLabel = { t ( 'Group' ) } > { resource . group || '-' } </ Td >
24+ < div className = "resource-allow-deny-list" >
25+ < Table aria-label = "Resource Allow/Deny table" borders >
26+ < Thead >
27+ < Tr >
28+ < Th className = "resource-allow-deny-list__kind" > { t ( 'Kind' ) } </ Th >
29+ < Th className = "resource-allow-deny-list__group" > { t ( 'Group' ) } </ Th >
3430 </ Tr >
35- ) ) }
36- </ Tbody >
37- </ Table >
31+ </ Thead >
32+ < Tbody >
33+ { resourceList . map ( ( resource , index ) => (
34+ < Tr key = { index } >
35+ < Td dataLabel = { t ( 'Kind' ) } className = "resource-allow-deny-list__kind" >
36+ { resource . kind || '-' }
37+ </ Td >
38+ < Td dataLabel = { t ( 'Group' ) } className = "resource-allow-deny-list__group" >
39+ { resource . group || '-' }
40+ </ Td >
41+ </ Tr >
42+ ) ) }
43+ </ Tbody >
44+ </ Table >
45+ </ div >
3846 ) : (
3947 < EmptyState headingLevel = "h4" icon = { CubesIcon } titleText = { t ( 'No resources configured' ) } >
4048 < EmptyStateBody > { t ( 'This list does not have any resources configured.' ) } </ EmptyStateBody >
4149 </ EmptyState >
4250 ) }
43- </ PageSection >
51+ </ >
4452 ) ;
4553} ;
4654
0 commit comments