<commit_before>React                     = require 'kd-react'
Popover                   = require 'app/components/common/popover'
actions                   = require 'app/flux/environment/actions'
SidebarWidget             = require './sidebarwidget'
InvitationWidgetUserView  = require './invitationwidgetuserview'
EnvironmentFlux           = require 'app/flux/environment'


module.exports = class SharingMachineInvitationWidget extends React.Component

  onRejectClicked: ->

    actions.rejectInvitation @props.machine


  onAcceptClicked: ->

    actions.acceptInvitation @props.machine


  render: ->
<commit_msg>Client: Sidebar: Added setCoordinates method to calculate invitationWidget coordinates by related machineListItem<commit_after>React                     = require 'kd-react'
Popover                   = require 'app/components/common/popover'
actions                   = require 'app/flux/environment/actions'
SidebarWidget             = require './sidebarwidget'
InvitationWidgetUserView  = require './invitationwidgetuserview'
EnvironmentFlux           = require 'app/flux/environment'


module.exports = class SharingMachineInvitationWidget extends React.Component

  onRejectClicked: ->

    actions.rejectInvitation @props.machine


  onAcceptClicked: ->

    actions.acceptInvitation @props.machine


  setCoordinates: ->

    listItemNode = ReactDOM.findDOMNode @props.listItem

    if listItemNode
      clientRect    = listItemNode.getBoundingClientRect()
      { top, left, width } = clientRect
      left = left + width
      top  = top - 15
      @coordinates = { top, left }


  render: ->

{'fraction_non_alphanumeric': 0.08081431215299198, 'fraction_numerical': 0.0012338062924120913, 'mean_word_length': 2.798594847775176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '7395918', 'n_tokens_mistral': 441, 'n_tokens_neox': 409, 'n_words': 92}