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

import InterfacePanel from 'interface/others/Panel';
import STATISTIC_CATEGORY from 'interface/others/STATISTIC_CATEGORY';

const Panel = ({ category, position, ...others }) => (
  <InterfacePanel
    {...others}
  />
);
Panel.propTypes = {
  children: PropTypes.node.isRequired,
  // eslint-disable-next-line react/no-unused-prop-types
  category: PropTypes.oneOf(Object.values(STATISTIC_CATEGORY)),
  // eslint-disable-next-line react/no-unused-prop-types
  position: PropTypes.number,
};
Panel.defaultProps = {
  category: STATISTIC_CATEGORY.PANELS,
};

export default Panel;<commit_msg>Add error boundary to statistics Panel so they can't crash the entire statistics page<commit_after>import React from 'react';
import PropTypes from 'prop-types';

import InterfacePanel from 'interface/others/Panel';
import STATISTIC_CATEGORY from 'interface/others/STATISTIC_CATEGORY';
import ErrorBoundary from 'interface/common/ErrorBoundary';

const Panel = ({ category, position, ...others }) => (
  <ErrorBoundary>
    <InterfacePanel
      {...others}
    />
  </ErrorBoundary>
);
Panel.propTypes = {
  children: PropTypes.node.isRequired,
  // eslint-disable-next-line react/no-unused-prop-types
  category: PropTypes.oneOf(Object.values(STATISTIC_CATEGORY)),
  // eslint-disable-next-line react/no-unused-prop-types
  position: PropTypes.number,
};
Panel.defaultProps = {
  category: STATISTIC_CATEGORY.PANELS,
};

export default Panel;
{'fraction_non_alphanumeric': 0.12623925974884337, 'fraction_numerical': 0.0, 'mean_word_length': 4.756653992395437, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '6939633', 'n_tokens_mistral': 477, 'n_tokens_neox': 484, 'n_words': 98}