<commit_before>import React from 'react';

const ReferenceCell = (refs) => {
  return refs.map((ref) => {
    if (ref.pubMedId && ref.pubMedUrl) {
      return <a href={ref.pubMedUrl}>{ref.pubMedId}</a>;
    } else {
      return <span>{ref.publicationModId}</span>;
    }
  })
  .reduce((prev, curr) => [prev, ', ', curr]);
};

export default ReferenceCell;
<commit_msg>Handle case where reference list is undefined due to filtering<commit_after>import React from 'react';

const ReferenceCell = (refs) => {
  return refs && refs.map((ref) => {
    if (ref.pubMedId && ref.pubMedUrl) {
      return <a href={ref.pubMedUrl}>{ref.pubMedId}</a>;
    } else {
      return <span>{ref.publicationModId}</span>;
    }
  })
  .reduce((prev, curr) => [prev, ', ', curr]);
};

export default ReferenceCell;

{'fraction_non_alphanumeric': 0.18272841051314143, 'fraction_numerical': 0.0, 'mean_word_length': 3.5977011494252875, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '1781585', 'n_tokens_mistral': 274, 'n_tokens_neox': 274, 'n_words': 60}