]> git.localhorst.tv Git - alttp.git/blob - resources/js/components/tracker/CountDisplay.js
svg dungeon tracker
[alttp.git] / resources / js / components / tracker / CountDisplay.js
1 import PropTypes from 'prop-types';
2 import React from 'react';
3
4 const CountDisplay = ({ className, count, full }) => {
5         const classNames = ['count-display'];
6         if (className) {
7                 classNames.push(className);
8         }
9         if (!count) {
10                 classNames.push('is-zero');
11         }
12         if (full && count >= full) {
13                 classNames.push('is-full');
14         }
15         return <text className={classNames.join(' ')}>
16                 {count}
17         </text>;
18 };
19
20 CountDisplay.propTypes = {
21         className: PropTypes.string,
22         count: PropTypes.number,
23         full: PropTypes.number,
24 };
25
26 export default CountDisplay;