// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React from 'react';
import TeamStore from 'stores/team_store.jsx';
import {FormattedMessage} from 'react-intl';
import AddIntegrationOption from './add_integration_option.jsx';
import WebhookIcon from 'images/webhook_icon.jpg';
export default class AddIntegration extends React.Component {
constructor(props) {
super(props);
this.handleChange = this.handleChange.bind(this);
this.state = {
team: TeamStore.getCurrent()
};
}
componentDidMount() {
TeamStore.addChangeListener(this.handleChange);
}
componentWillUnmount() {
TeamStore.removeChangeListener(this.handleChange);
}
handleChange() {
this.setState({
team: TeamStore.getCurrent()
});
}
render() {
const team = TeamStore.getCurrent();
if (!team) {
return null;
}
const options = [];
if (window.mm_config.EnableIncomingWebhooks === 'true') {
options.push(