import React, { Component, Fragment } from 'react'; import { withNamespaces } from 'react-i18next'; import PropTypes from 'prop-types'; import ClientsTable from './ClientsTable'; import AutoClients from './AutoClients'; import PageTitle from '../../ui/PageTitle'; import Loading from '../../ui/Loading'; class Clients extends Component { componentDidMount() { this.props.getClients(); this.props.getStats(); } render() { const { t, dashboard, stats, clients, addClient, updateClient, deleteClient, toggleClientModal, } = this.props; return ( {(stats.processingStats || dashboard.processingClients) && } {!stats.processingStats && !dashboard.processingClients && ( )} ); } } Clients.propTypes = { t: PropTypes.func.isRequired, dashboard: PropTypes.object.isRequired, stats: PropTypes.object.isRequired, clients: PropTypes.object.isRequired, toggleClientModal: PropTypes.func.isRequired, deleteClient: PropTypes.func.isRequired, addClient: PropTypes.func.isRequired, updateClient: PropTypes.func.isRequired, getClients: PropTypes.func.isRequired, getStats: PropTypes.func.isRequired, }; export default withNamespaces()(Clients);