// 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({ handleInvite: function() { this.props.handleInvite(this.props.member.id); }, handleRemove: function() { this.props.handleRemove(this.props.member.id); }, handleMakeAdmin: function() { 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; if (member.roles === '') { member.roles = 'Member'; } else { member.roles = member.roles.charAt(0).toUpperCase() + member.roles.slice(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 = (