import PropTypes from 'prop-types';
// Copyright (c) 2016-present 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: PropTypes.node,
header: PropTypes.node.isRequired,
addLink: PropTypes.string,
addText: PropTypes.node,
emptyText: PropTypes.node,
helpText: PropTypes.node,
loading: PropTypes.bool.isRequired,
searchPlaceholder: PropTypes.string
}
static defaultProps = {
searchPlaceholder: Utils.localizeMessage('backstage_list.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 =