_ = require 'underscore' path = require 'path' React = require 'react' {RetinaImg} = require 'nylas-component-kit' {Actions, Utils, ComponentRegistry, EventStore, AccountStore} = require 'nylas-exports' moment = require 'moment-timezone' class EventComponent extends React.Component @displayName: 'EventComponent' @propTypes: event: React.PropTypes.object.isRequired constructor: (@props) -> @state = @_getStateFromStores() _onChange: => @setState(@_getStateFromStores()) _getStateFromStores: -> e = EventStore.getEvent(@props.event.id) e ?= @props.event componentWillMount: -> @unsub = EventStore.listen(@_onChange) componentWillUnmount: -> @unsub() _myStatus: => myEmail = AccountStore.current()?.me().email for p in @state.participants if p['email'] == myEmail return p['status'] return null render: =>