-
Notifications
You must be signed in to change notification settings - Fork 6
/
Pill.tsx
35 lines (32 loc) · 907 Bytes
/
Pill.tsx
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
import Chip from "@mui/material/Chip";
export function Pill(props: any) {
const getSeverity = (severity: string): string => {
switch (severity) {
case "CRITICAL":
return "red";
case "HIGH":
return "orangered";
case "MEDIUM":
return "orange";
case "LOW":
return "gray";
default:
return "gray";
}
}
return (
<Chip
label={props.item.severity}
sx={{
borderRadius: '4px',
fontSize: '.8rem',
fontWeight: 600,
padding: '2px',
width: '100px',
minWidth: '100px',
bgcolor: getSeverity(props.item.severity),
color: 'white',
marginRight: '1rem',
}} />
)
}