From 7c69c7207d9754130a84619d910feaf66754dd04 Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Fri, 13 Nov 2020 21:09:41 -0500 Subject: Add cards for total cases --- src/Card.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/Card.js (limited to 'src/Card.js') 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 ( +
+

{props.name}

+

+ {props.latest} + {props.suffix}{" "} + + ({diff} + {props.suffix}) + +

+
+ ); +}; + +export default Card; -- cgit v1.2.3