// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. var ChannelStore = require('../stores/channel_store.jsx'); var UserStore = require('../stores/user_store.jsx'); module.exports = React.createClass({ displayName: 'MemberListItem', handleInvite: function(e) { e.preventDefault(); this.props.handleInvite(this.props.member.id); }, handleRemove: function(e) { e.preventDefault(); this.props.handleRemove(this.props.member.id); }, handleMakeAdmin: function(e) { e.preventDefault(); this.props.handleMakeAdmin(this.props.member.id); }, render: function() { var member = this.props.member; var isAdmin = this.props.isAdmin; var isMemberAdmin = member.roles.indexOf("admin") > -1; var invite; if (member.invited && this.props.handleInvite) { invite = Added; } else if (this.props.handleInvite) { invite = Add; } else if (isAdmin && !isMemberAdmin && (member.id != UserStore.getCurrentId())) { var self = this; invite = (