-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathInfoBox.js
30 lines (25 loc) · 939 Bytes
/
InfoBox.js
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
import React from 'react'
import { Card, CardContent, Typography} from '@material-ui/core'
import './InfoBox.css'
function InfoBox({ title, cases, total, active, color, ...props}) {
let headingcolor
if(title === 'Recovered'){
headingcolor = 'green'
} else {
headingcolor = "red"
}
return (
<Card className = {`infoBox ${active && 'infoBox--selected'} `} onClick = {props.onClick}>
<CardContent>
<Typography color = "textSecondary" className = "infoBox__title">
{title}
</Typography>
<h2 className = "infoBox__cases" style = {{color: headingcolor}}>{cases}</h2>
<Typography color = "textSecondary" className = "infoBox__total">
{total} Total
</Typography>
</CardContent>
</Card>
)
}
export default InfoBox;