// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import React from 'react';
import * as Utils from 'utils/utils.jsx';
import {Link} from 'react-router';
import LoadingScreen from 'components/loading_screen.jsx';
export default class BackstageList extends React.Component {
static propTypes = {
children: React.PropTypes.node,
header: React.PropTypes.node.isRequired,
addLink: React.PropTypes.string,
addText: React.PropTypes.node,
emptyText: React.PropTypes.node,
helpText: React.PropTypes.node,
loading: React.PropTypes.bool.isRequired,
searchPlaceholder: React.PropTypes.string
}
static defaultProps = {
searchPlaceholder: Utils.localizeMessage('backstage.search', 'Search')
}
constructor(props) {
super(props);
this.updateFilter = this.updateFilter.bind(this);
this.state = {
filter: ''
};
}
updateFilter(e) {
this.setState({
filter: e.target.value
});
}
render() {
const filter = this.state.filter.toLowerCase();
let children;
if (this.props.loading) {
children =