forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSummaryGroup.js
More file actions
77 lines (71 loc) · 1.76 KB
/
SummaryGroup.js
File metadata and controls
77 lines (71 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import React from 'react'
import { t, Trans } from '@lingui/macro'
import { Flex, Text } from '@chakra-ui/react'
import { object } from 'prop-types'
import { SummaryCard } from './SummaryCard'
import theme from '../theme/canada'
export function SummaryGroup({ web, mail }) {
const { colors } = theme
const webCard = web ? (
<SummaryCard
title={t`Web Configuration`}
description={t`Web encryption settings summary`}
categoryDisplay={{
fail: {
name: t`Non-compliant TLS`,
color: colors.weak,
},
pass: {
name: t`Compliant TLS`,
color: colors.strong,
},
unscanned: {
name: t`Unscanned`,
color: colors.gray['400'],
},
}}
data={web}
mb={{ base: 6, md: 0 }}
/>
) : (
<Text fontWeight="bold" textAlign="center">
<Trans>No web configuration information available for this org.</Trans>
</Text>
)
const mailCard = mail ? (
<SummaryCard
title={t`Email Configuration`}
description={t`Email security settings summary`}
categoryDisplay={{
pass: {
name: t`DMARC pass`,
color: colors.strong,
},
fail: {
name: t`DMARC fail`,
color: colors.weak,
},
unscanned: {
name: t`Unscanned`,
color: colors.gray['400'],
},
}}
data={mail}
mb={{ base: 6, md: 0 }}
/>
) : (
<Text fontWeight="bold" textAlign="center">
<Trans>No mail configuration information available for this org.</Trans>
</Text>
)
return (
<Flex flexWrap="wrap" justifyContent="space-evenly">
{webCard}
{mailCard}
</Flex>
)
}
SummaryGroup.propTypes = {
web: object,
mail: object,
}