<commit_before>// @flow
import React, { Component } from 'react'
import { graphql, createFragmentContainer } from 'react-relay'
import { isEmpty } from 'ramda'

import Subhead from 'components/ui/Subhead'
import SidebarList from 'components/ui/SidebarList'
import List from 'components/ui/List'
import Link from 'components/ui/Link'
import Topic from 'components/ui/Topic'
import Breadcrumbs from 'components/ui/Breadcrumbs'
import type { TopicType } from '../types'
import { liftNodes } from '../../utils'

/* eslint no-underscore-dangle: 0 */

type Props = {
  location: Object,
  orgLogin: string,
  router: Object,
  topic: TopicType,
  viewer: {
    defaultRepository: Object,
  },
  view: {
    currentRepository: Object,
  },
}

class TopicSearchPage extends Component<Props> {
  renderSearchResultItem = (item) => {
    if (item.__typename === 'Link') {
      return (
        <Link
          key={item.id}
          link={item}
        />
      )
    }

    return (
      <Topic
        key={item.id}
        topic={item}
      />
    )
  }

  render = () => {
    const { location, orgLogin, router, topic, view, viewer } = this.props
    const {
      searchResults,
      name,
      parentTopics,
    } = topic
    const rows = liftNodes(searchResults)<commit_msg>Fix mutation error<commit_after>// @flow
import React, { Component } from 'react'
import { graphql, createFragmentContainer } from 'react-relay'
import { isEmpty } from 'ramda'

import Subhead from 'components/ui/Subhead'
import SidebarList from 'components/ui/SidebarList'
import List from 'components/ui/List'
import Link from 'components/ui/Link'
import Topic from 'components/ui/Topic'
import Breadcrumbs from 'components/ui/Breadcrumbs'
import type { TopicType } from '../types'
import { liftNodes } from '../../utils'

/* eslint no-underscore-dangle: 0 */

type Props = {
  location: Object,
  orgLogin: string,
  router: Object,
  topic: TopicType,
  viewer: {
    defaultRepository: Object,
  },
  view: {
    currentRepository: Object,
  },
}

class TopicSearchPage extends Component<Props> {
  renderSearchResultItem = (item) => {
    if (item.__typename === 'Link') {
      return (
        <Link
          key={item.id}
          orgLogin={this.props.orgLogin}
          link={item}
        />
      )
    }

    return (
      <Topic
        key={item.id}
        orgLogin={this.props.orgLogin}
        topic={item}
      />
    )
  }

  render = () => {
    const { location, orgLogin, router, topic, view, viewer } = this.props
    const {
      searchResults,
      name,
      parentTopics,
    } = topic
    const rows = liftNodes(searchResults)
{'fraction_non_alphanumeric': 0.12495266944339266, 'fraction_numerical': 0.0007572889057175312, 'mean_word_length': 2.7263751763046544, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, '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': '5818467', 'n_tokens_mistral': 830, 'n_tokens_neox': 821, 'n_words': 207}