<commit_before>import React from 'react';
import PropTypes from 'prop-types';

import './icon-styles.scss';

const Icon = ({ icon, className }) => (
  <svg className={`c-icon ${className}`} viewBox={icon.viewBox}>
    <use xlinkHref={`#${icon.id}`} />
  </svg>
);

Icon.propTypes = {
  icon: PropTypes.object,
  className: PropTypes.string
};

Icon.defaultProps = {
  className: ''
};
<commit_msg>support for non imported icons from header defs<commit_after>import React from 'react';
import PropTypes from 'prop-types';

import './icon-styles.scss';

const Icon = ({ icon, className }) => (
  <svg className={`c-icon ${className}`} viewBox={icon.viewBox || '0 0 32 32'}>
    <use xlinkHref={`#${icon.id || icon}`} />
  </svg>
);

Icon.propTypes = {
  icon: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  className: PropTypes.string
};

Icon.defaultProps = {
  className: ''
};

{'fraction_non_alphanumeric': 0.18721973094170405, 'fraction_numerical': 0.006726457399103139, 'mean_word_length': 4.379518072289157, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '128367', 'n_tokens_mistral': 303, 'n_tokens_neox': 307, 'n_words': 69}