Katello/katello

View on GitHub
webpack/scenes/ContentViews/components/IconWithCount.js

Summary

Maintainability
A
1 hr
Test Coverage
import React from 'react';
import PropTypes from 'prop-types';
import './IconWithCount.scss';

const IconWithCount = ({ count, title, Icon }) => (
  <React.Fragment>
    <Icon title={title} className="ktable-cell-icon" />
    {count}
  </React.Fragment>
);

IconWithCount.propTypes = {
  count: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
  title: PropTypes.string.isRequired,
  Icon: PropTypes.elementType.isRequired,
};

export default IconWithCount;