// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved. // See License.txt for license information. import {FormattedMessage} from 'mm-intl'; var Modal = ReactBootstrap.Modal; export default class SelectTeamModal extends React.Component { constructor(props) { super(props); this.doSubmit = this.doSubmit.bind(this); this.doCancel = this.doCancel.bind(this); } doSubmit(e) { e.preventDefault(); this.props.onModalSubmit(ReactDOM.findDOMNode(this.refs.team).value); } doCancel() { this.props.onModalDismissed(); } render() { if (this.props.teams == null) { return
; } var options = []; for (var key in this.props.teams) { if (this.props.teams.hasOwnProperty(key)) { var team = this.props.teams[key]; options.push( ); } } return (
); } } SelectTeamModal.defaultProps = { show: false }; SelectTeamModal.propTypes = { teams: React.PropTypes.object, show: React.PropTypes.bool.isRequired, onModalSubmit: React.PropTypes.func, onModalDismissed: React.PropTypes.func };