11import React from 'react'
2- import { t } from '@lingui/macro'
3- import { SimpleGrid } from '@chakra-ui/core'
2+ import { t , Trans } from '@lingui/macro'
3+ import { SimpleGrid , Text } from '@chakra-ui/core'
44import SummaryCard from './SummaryCard'
55import { object } from 'prop-types'
66import theme from './theme/canada'
77
88const { colors } = theme
99
1010export function SummaryGroup ( { web, mail } ) {
11+ const webCard = web ? (
12+ < SummaryCard
13+ title = { t `Web Configuration` }
14+ description = { t `Web encryption settings summary` }
15+ categoryDisplay = { {
16+ fail : {
17+ name : t `Non-compliant TLS` ,
18+ color : colors . weak ,
19+ } ,
20+ pass : {
21+ name : t `Compliant TLS` ,
22+ color : colors . strong ,
23+ } ,
24+ } }
25+ data = { web }
26+ />
27+ ) : (
28+ < Text fontWeight = "bold" textAlign = "center" >
29+ < Trans > No web configuration information available for this org.</ Trans >
30+ </ Text >
31+ )
32+
33+ const mailCard = mail ? (
34+ < SummaryCard
35+ title = { t `Email Configuration` }
36+ description = { t `Email security settings summary` }
37+ categoryDisplay = { {
38+ pass : {
39+ name : t `DMARC pass` ,
40+ color : colors . strong ,
41+ } ,
42+ fail : {
43+ name : t `DMARC fail` ,
44+ color : colors . weak ,
45+ } ,
46+ } }
47+ data = { mail }
48+ />
49+ ) : (
50+ < Text fontWeight = "bold" textAlign = "center" >
51+ < Trans > No mail configuration information available for this org.</ Trans >
52+ </ Text >
53+ )
1154 return (
1255 < SimpleGrid
1356 columns = { [ 1 , 1 , 1 , 2 ] }
@@ -17,36 +60,8 @@ export function SummaryGroup({ web, mail }) {
1760 mx = "auto"
1861 p = { [ '2' , '8' ] }
1962 >
20- < SummaryCard
21- title = { t `Web Configuration` }
22- description = { t `Web encryption settings summary` }
23- categoryDisplay = { {
24- fail : {
25- name : t `Non-compliant TLS` ,
26- color : colors . weak ,
27- } ,
28- pass : {
29- name : t `Compliant TLS` ,
30- color : colors . strong ,
31- } ,
32- } }
33- data = { web }
34- />
35- < SummaryCard
36- title = { t `Email Configuration` }
37- description = { t `Email security settings summary` }
38- categoryDisplay = { {
39- pass : {
40- name : t `DMARC pass` ,
41- color : colors . strong ,
42- } ,
43- fail : {
44- name : t `DMARC fail` ,
45- color : colors . weak ,
46- } ,
47- } }
48- data = { mail }
49- />
63+ { webCard }
64+ { mailCard }
5065 </ SimpleGrid >
5166 )
5267}
0 commit comments