<commit_before>React = require 'react'
Radium = require 'radium'
Link = require './link-component'
DocSignaturesComponent = require './doc-signatures-component'

class DocDetailTitleComponent extends React.Component
  constructor: (props) ->
    super props

  close: ->
    @context.ctx.routeAction.navigate(document.location.pathname.match(/^(.+)\/[^\/]+$/)[1])

  genKindStringStyle: (kindString) ->
    color = '#333333'

    switch kindString
      when 'Constructor'
        color = '#337BFF'
      when 'Property'
        color = '#598213'
      when 'Method'
        color = '#6E00FF'
        # color = '#B17509'
      when 'Accessor'
        color = '#D04C35'
      else
        color = '#333333'

    style =
      color: color
      borderColor: color

  render: ->
    <div style={Array.prototype.concat.apply([], [styles.base, @props.style])}>
      <div style={styles.title_wrap}>
        <div style={[styles.kind_string, @genKindStringStyle(@props.current.kindString)]}>{@props.current.kindString}</div>
        <div style={[styles.title]}>
          <span style={styles.title_from} onClick={@close.bind(@)}>{@props.from.name}</span>.<span>{@props.current.name}</span>
        </div>
      </div>
      <DocSignaturesComponent style={styles.signatures} current={@props.current} />
    </div>

styles =
  base:
    marginBottom: 40
<commit_msg>remove class name from title of DocDetail<commit_after>React = require 'react'
Radium = require 'radium'
Link = require './link-component'
DocSignaturesComponent = require './doc-signatures-component'

class DocDetailTitleComponent extends React.Component
  constructor: (props) ->
    super props

  genKindStringStyle: (kindString) ->
    color = '#333333'

    switch kindString
      when 'Constructor'
        color = '#337BFF'
      when 'Property'
        color = '#598213'
      when 'Method'
        color = '#6E00FF'
        # color = '#B17509'
      when 'Accessor'
        color = '#D04C35'
      else
        color = '#333333'

    style =
      color: color
      borderColor: color

  render: ->
    <div style={Array.prototype.concat.apply([], [styles.base, @props.style])}>
      <div style={styles.title_wrap}>
        <div style={[styles.kind_string, @genKindStringStyle(@props.current.kindString)]}>{@props.current.kindString}</div>
        <div style={[styles.title]}>
          <span>.</span><span>{@props.current.name}</span>
        </div>
      </div>
      <DocSignaturesComponent style={styles.signatures} current={@props.current} />
    </div>

styles =
  base:
    marginBottom: 40

{'fraction_non_alphanumeric': 0.15297781237835734, 'fraction_numerical': 0.027637212923316466, 'mean_word_length': 2.8880484114977305, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 36, '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': '1084703', 'n_tokens_mistral': 835, 'n_tokens_neox': 786, 'n_words': 160}