aboutsummaryrefslogtreecommitdiff
path: root/src/Card.js
diff options
context:
space:
mode:
authorGalen Guyer <galen@galenguyer.com>2020-11-13 21:09:41 -0500
committerGalen Guyer <galen@galenguyer.com>2020-11-13 21:09:41 -0500
commit7c69c7207d9754130a84619d910feaf66754dd04 (patch)
tree717c15222bfe390f437a5a4b7a65ef1e3e0e3773 /src/Card.js
parent26f0066f9b2daa904d4fe4cac80841cbe40360ca (diff)
Add cards for total cases
Diffstat (limited to 'src/Card.js')
-rw-r--r--src/Card.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/Card.js b/src/Card.js
new file mode 100644
index 0000000..310848d
--- /dev/null
+++ b/src/Card.js
@@ -0,0 +1,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">
+ <h3>{props.name}</h3>
+ <p>
+ {props.latest}
+ {props.suffix}{" "}
+ <span className="Diff">
+ ({diff}
+ {props.suffix})
+ </span>
+ </p>
+ </div>
+ );
+};
+
+export default Card;