-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInfoBox.js
27 lines (24 loc) · 990 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
import React from 'react'
import { Card, CardContent, Typography } from '@material-ui/core'
import "./InfoBox.css";
function InfoBox({ title, cases,isRed,active,total, ...props }) {
return (
<Card
onClick={props.onClick}
className={`infoBox && ${active && "infoBox--selected"}
${isRed && 'infoBox--red'}`}
>
<CardContent>
{/*Card title like Corona cases */}
<Typography className="infoBox__title" color="textSecondary">
{title}
</Typography>
<h2 className={`infoBox__cases ${!isRed && "infoBox__cases--green"}`}>{cases}</h2>{/*1.200 cases */}
<Typography className="infoBox__total" color="textSecondary">{/*1.2m */}
{total}Total
</Typography>
</CardContent>
</Card>
)
}
export default InfoBox