mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
64 lines
1.5 KiB
JavaScript
64 lines
1.5 KiB
JavaScript
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 (
|
|
<CustomersListProvider
|
|
tableState={customersTableState}
|
|
tableStateChanged={customersTableStateChanged}
|
|
>
|
|
<CustomersActionsBar />
|
|
|
|
<DashboardPageContent>
|
|
<CustomersViewsTabs />
|
|
<CustomersTable />
|
|
</DashboardPageContent>
|
|
<CustomersAlerts />
|
|
</CustomersListProvider>
|
|
);
|
|
}
|
|
|
|
export default compose(
|
|
withCustomers(({ customersTableState, customersTableStateChanged }) => ({
|
|
customersTableState,
|
|
customersTableStateChanged,
|
|
})),
|
|
withCustomersActions,
|
|
)(CustomersList);
|