<commit_before>kd                   = require 'kd'
React                = require 'kd-react'
ReactDOM             = require 'react-dom'
Link                 = require 'app/components/common/link'
TimeAgo              = require 'app/components/common/timeago'
immutable            = require 'immutable'
MessageLink          = require 'activity/components/messagelink'
MessageBody          = require 'activity/components/common/messagebody'
ProfileText          = require 'app/components/profile/profiletext'
MessageLikeSummary   = require 'activity/components/common/messagelikesummary'
ProfileLinkContainer = require 'app/components/profile/profilelinkcontainer'
AutoSizeTextarea     = require 'app/components/common/autosizetextarea'
ActivityLikeLink     = require 'activity/components/chatlistitem/activitylikelink'
Comments             = require 'activity/components/comments'
ActivitySharePopup   = require 'activity/components/activitysharepopup'
Avatar               = require 'app/components/profile/avatar'

module.exports = class FeedItem extends React.Component

  @defaultProps =
    message: immutable.Map()

  constructor: (props) ->

    super props

    @state =
      isPopupOpen  : no


  shouldComponentUpdate: (nextProps, nextState) ->

    return @props.message isnt nextProps.message or @state isnt nextState


  handleCommentLinkClick: (event) ->

    kd.utils.stopDOMEvent event
    @refs.Comments.focusCommentInput()


  toggleSharePopupVisibility: (event) ->

    kd.utils.stopDOMEvent event

    @setState { isPopupOpen: not @state.isPopupOpen }



  renderFeedItemMenu: ->

    <MessageItemMenu message={@props.message}/>

  render: ->

    { message } = @props
    likeText = if message.getIn ['interactions', 'like',  'isInteracted'] then 'Unlike' else 'Like'<commit_msg>Client: Activity: Feed: Formatting<commit_after>kd                   = require 'kd'
React                = require 'kd-react'
Link                 = require 'app/components/common/link'
TimeAgo              = require 'app/components/common/timeago'
immutable            = require 'immutable'
MessageLink          = require 'activity/components/messagelink'
MessageBody          = require 'activity/components/common/messagebody'
ProfileText          = require 'app/components/profile/profiletext'
ActivityFlux         = require 'activity/flux'
Comments             = require 'activity/components/comments'
ActivitySharePopup   = require 'activity/components/activitysharepopup'
Avatar               = require 'app/components/profile/avatar'
MessageItemMenu      = require 'activity/components/messageitemmenu'
classnames           = require 'classnames'
FeedItemInputWidget  = require './feediteminputwidget'
MessageLikeSummary   = require 'activity/components/common/messagelikesummary'
ProfileLinkContainer = require 'app/components/profile/profilelinkcontainer'
ActivityLikeLink     = require 'activity/components/chatlistitem/activitylikelink'

module.exports = class FeedItem extends React.Component

  @defaultProps =
    channelId : null
    message   : immutable.Map()

  constructor: (props) ->

    super props

    @state = { isPopupOpen : no }


  shouldComponentUpdate: (nextProps, nextState) ->

    return @props.message isnt nextProps.message or @state isnt nextState


  handleCommentLinkClick: (event) ->

    kd.utils.stopDOMEvent event

    @refs.Comments.focusCommentInput()


  toggleSharePopupVisibility: (event) ->

    kd.utils.stopDOMEvent event

    @setState { isPopupOpen: not @state.isPopupOpen }



  renderFeedItemMenu: ->

    <MessageItemMenu message={@props.message}/>

  render: ->

    { message } = @props
    likeText = if message.getIn ['interactions', 'like',  'isInteracted'] then 'Unlike' else 'Like'
{'fraction_non_alphanumeric': 0.0953780390061448, 'fraction_numerical': 0.0, 'mean_word_length': 3.249716231555051, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6645856', 'n_tokens_mistral': 1056, 'n_tokens_neox': 1007, 'n_words': 216}