]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/tracker/CountDisplay.js
basic auto tracking
[alttp.git] / resources / js / components / tracker / CountDisplay.js
diff --git a/resources/js/components/tracker/CountDisplay.js b/resources/js/components/tracker/CountDisplay.js
new file mode 100644 (file)
index 0000000..ed9b91f
--- /dev/null
@@ -0,0 +1,22 @@
+import PropTypes from 'prop-types';
+import React from 'react';
+
+const CountDisplay = ({ className, count }) => {
+       const classNames = ['count-display'];
+       if (className) {
+               classNames.push(className);
+       }
+       if (!count) {
+               classNames.push('is-zero');
+       }
+       return <span className={classNames.join(' ')}>
+               {count}
+       </span>;
+};
+
+CountDisplay.propTypes = {
+       className: PropTypes.string,
+       count: PropTypes.number,
+};
+
+export default CountDisplay;