import PropTypes from 'prop-types'; import { PureComponent } from 'react'; import Connection from './connection'; class ConnectionsList extends PureComponent { static propTypes = { connections: PropTypes.array, onToggle: PropTypes.func, siteId: PropTypes.number, siteSlug: PropTypes.string, }; static defaultProps = { connections: [], }; renderEmptyPlaceholder() { return (
); } render() { const { connections, onToggle, siteId } = this.props; if ( ! siteId || ! connections.length ) { return null; } if ( ! this.props.hasFetchedConnections ) { return this.renderEmptyPlaceholder(); } return (
{ connections.map( ( connection ) => ( ) ) }
); } } export default ConnectionsList;