import React, { useEffect } from 'react'; import 'style/pages/Customers/List.scss'; import { DashboardPageContent } from 'components'; import CustomersActionsBar from './CustomersActionsBar'; import CustomersViewsTabs from './CustomersViewsTabs'; import CustomersTable from './CustomersTable'; import CustomersAlerts from 'containers/Customers/CustomersAlerts'; import { CustomersListProvider } from './CustomersListProvider'; import withCustomers from './withCustomers'; import withCustomersActions from './withCustomersActions'; import { compose } from 'utils'; /** * Customers list. */ function CustomersList({ // #withCustomers customersTableState, customersTableStateChanged, // #withCustomersActions setCustomersTableState, }) { // Resets the accounts table state once the page unmount. useEffect( () => () => { setCustomersTableState({ filterRoles: [], viewSlug: '', pageIndex: 0, }); }, [setCustomersTableState], ); return ( ); } export default compose( withCustomers(({ customersTableState, customersTableStateChanged }) => ({ customersTableState, customersTableStateChanged, })), withCustomersActions, )(CustomersList);