 React = require 'react'
 MarkdownIt = require 'markdown-it'
+{State} = require 'react-router'
 
 markdownIt = MarkdownIt()
   .use require 'markdown-it-emoji'


module?.exports = React.createClass
  displayName: 'TalkCommentPreview'

  propTypes:
    content: React.PropTypes.string

      .replace(/@(\b[\w-]+\b)/g, "<a href='#/users/$1'>$1</a>")

      # hashtags #tagname
      .replace /\#(\w+)/g, (fullTag, tagName) ->
        if owner and name
          "<a href='#/projects/#{owner}/#{name}/talk/search?query=#{tagName}'>#{fullTag}</a>"
        else
          "<a href='#/talk/search?query=#{tagName}'>#{fullTag}</a>"

  markdownify: (input) ->
    markdownIt.render(input)
