import React from 'react';
import PropTypes from 'prop-types';

class AverageTargetsHit extends React.PureComponent {
  static propTypes = {
    casts: PropTypes.string.isRequired,
    hits: PropTypes.string.isRequired,
    approximate: PropTypes.bool,
  };

  render() {
    const { casts, hits, approximate } = this.props;
    const averageHits = ((hits / casts) || 0).toFixed(1);
    return (
      <>
        {approximate && '≈'}{averageHits}{' average '}{averageHits > 1 ? 'targets hit' : 'target hit'}
      </>
    );
  }
}

export default AverageTargetsHit;

AverageTargetsHit.defaultProps = {
  approximate: false,
};

@@ -147,38 +147,38 @@
 asts: PropTypes.
-string
+number
 .isRequired,%0A   
@@ -198,14 +198,14 @@
 pes.
-string
+number
 .isR

change ATH to number