You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
560 B

  1. // Package imports.
  2. import classNames from 'classnames';
  3. import PropTypes from 'prop-types';
  4. import React from 'react';
  5. // This just renders a FontAwesome icon.
  6. export default function Icon ({
  7. className,
  8. fullwidth,
  9. icon,
  10. }) {
  11. const computedClass = classNames('icon', 'fa', { 'fa-fw': fullwidth }, `fa-${icon}`, className);
  12. return icon ? (
  13. <span
  14. aria-hidden='true'
  15. className={computedClass}
  16. />
  17. ) : null;
  18. }
  19. // Props.
  20. Icon.propTypes = {
  21. className: PropTypes.string,
  22. fullwidth: PropTypes.bool,
  23. icon: PropTypes.string,
  24. };