// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // See License.txt for license information. var ChannelStore = require('../stores/channel_store.jsx'); export default class CommandList extends React.Component { constructor(props) { super(props); this.state = { channel_id: ChannelStore.getCurrentId() }; } componentDidMount() { var self = this; if (this.refs.modal) { $(React.findDOMNode(this.refs.modal)).on('show.bs.modal', function show(e) { var button = e.relatedTarget; self.setState({channel_id: $(button).attr('data-channelid')}); }); } } render() { var channel = ChannelStore.get(this.state.channel_id); if (!channel) { channel = {}; channel.display_name = 'No Channel Found'; channel.name = 'No Channel Found'; channel.id = 'No Channel Found'; } return ( ); } }