<commit_before>import {
  isStreamNarrow,
  isTopicNarrow,
  isPrivateNarrow,
  isGroupNarrow,
  streamNarrow,
  topicNarrow,
  privateNarrow,
  groupNarrow,
} from '../../utils/narrow';

const objToStr = obj => JSON.stringify(obj).replace(/"/g, "'");

export default ({ item, subscriptions, auth, narrow, doNarrow }) => {
  if (isStreamNarrow(narrow)) {
    const streamNarrowStr = objToStr(streamNarrow(item.display_recipient));

    return `
      <div id="${item.id}" class="topic-header header" data-narrow="${streamNarrowStr}">
        ${item.subject}<commit_msg>Fix: undefined header is shown in WebView MessageList. (#1572)<commit_after>import {
  isStreamNarrow,
  isTopicNarrow,
  isPrivateNarrow,
  isGroupNarrow,
  streamNarrow,
  topicNarrow,
  privateNarrow,
  groupNarrow,
} from '../../utils/narrow';

const objToStr = obj => JSON.stringify(obj).replace(/"/g, "'");

export default ({ item, subscriptions, auth, narrow, doNarrow }) => {
  if (Object.keys(item).length === 0) {
    return '';
  }

  if (isStreamNarrow(narrow)) {
    const streamNarrowStr = objToStr(streamNarrow(item.display_recipient));

    return `
      <div id="${item.id}" class="topic-header header" data-narrow="${streamNarrowStr}">
        ${item.subject}
{'fraction_non_alphanumeric': 0.15637530072173217, 'fraction_numerical': 0.00400962309542903, 'mean_word_length': 4.265822784810126, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3616645', 'n_tokens_mistral': 425, 'n_tokens_neox': 415, 'n_words': 79}