forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatusIcon.js
More file actions
28 lines (26 loc) · 771 Bytes
/
StatusIcon.js
File metadata and controls
28 lines (26 loc) · 771 Bytes
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
import React from 'react'
import { string } from 'prop-types'
import { Spinner } from '@chakra-ui/react'
import { CheckCircleIcon, WarningIcon, InfoIcon } from '@chakra-ui/icons'
export function StatusIcon({ status }) {
if (status === 'PASS') {
return (
<CheckCircleIcon color="strong" size="icons.sm" aria-label="passes" />
)
} else if (status === 'FAIL') {
return <WarningIcon color="weak" size="icons.sm" aria-label="fails" />
} else if (status === 'LOADING') {
return <Spinner color="accent" size="sm" />
} else {
return (
<InfoIcon
color="info"
size="icons.sm"
aria-label="Information not sufficient, please view guidance"
/>
)
}
}
StatusIcon.propTypes = {
status: string.isRequired,
}