<commit_before>import { PropTypes } from 'react';
import Fragment from '../fragments/fragment';
import { getPerson } from '../data/store';

const Colleague = ({ personId }) => {
  const person = getPerson(personId);
  return <Fragment text={person.name} />;
}

Colleague.propTypes = {
  personId: PropTypes.string.isRequired,
};

export default Colleague;<commit_msg>Add Position to colleague<commit_after>import { PropTypes } from 'react';
import Fragments from '../fragments/fragments';
import { getPerson } from '../data/store';

const Colleague = ({ personId, position }) => {
  const person = getPerson(personId);
  const fragments = (() => {
    const nameFragment = person.name;
    const positionFragment = (() => {
      if (!position) { return null; }
      return `, ${position}`;
    })();

    return [nameFragment, positionFragment].filter((fragment) => !!fragment);
  })();

  return <Fragments fragments={fragments} />;
}

Colleague.propTypes = {
  personId: PropTypes.string.isRequired,
  position: PropTypes.string,
};

export default Colleague;
{'fraction_non_alphanumeric': 0.1561618062088429, 'fraction_numerical': 0.0, 'mean_word_length': 4.241379310344827, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '5144255', 'n_tokens_mistral': 315, 'n_tokens_neox': 309, 'n_words': 76}