blob: fea3cdae2ef8fc54cd45bc49417a1b13889ed090 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
import React from "react";
import "./Card.css";
const Card = (props) => {
let diff = props.latest - props.prior;
if (diff >= 0) {
diff = "+" + diff.toString();
}
return (
<div className="Card bg-white rounded-lg border-2 border-orange-300 p-4 m-4">
<h3 className="text-lg">{props.name}</h3>
<p>
{props.latest}
{props.suffix}{" "}
<span className="Diff text-gray-600 text-sm">
({diff}
{props.suffix})
</span>
</p>
</div>
);
};
export default Card;
|