context = window

var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup;

var BroadcastHolder = React.createClass({displayName: 'Broadcast Notification Holder',
  mixins: [Reflux.connect(context.JK.Stores.Broadcast, 'notification')],

  render: function() {
    var notification = []
    if(this.state.notification) {
      notification.push(<Broadcast key={this.state.notification.id} notification={this.state.notification}/>)
    }

    return (
      <div id="broadcast-notification-holder" className="broadcast-notification-holder" >
        <ReactCSSTransitionGroup transitionName="bn-slidedown">
          {notification}
        </ReactCSSTransitionGroup>
      </div>
    )
  }
});

// each file will export exactly one component
context.JK.Components.BroadcastHolder = BroadcastHolder
context.BroadcastHolder = BroadcastHolder
