mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
re-structure to monorepo.
This commit is contained in:
60
packages/webapp/src/containers/Accounts/AccountsChart.tsx
Normal file
60
packages/webapp/src/containers/Accounts/AccountsChart.tsx
Normal file
@@ -0,0 +1,60 @@
|
||||
// @ts-nocheck
|
||||
import React, { useEffect } from 'react';
|
||||
|
||||
import '@/style/pages/Accounts/List.scss';
|
||||
import { DashboardPageContent, DashboardContentTable } from '@/components';
|
||||
|
||||
import { AccountsChartProvider } from './AccountsChartProvider';
|
||||
import AccountsViewsTabs from './AccountsViewsTabs';
|
||||
import AccountsActionsBar from './AccountsActionsBar';
|
||||
import AccountsDataTable from './AccountsDataTable';
|
||||
|
||||
import withAccounts from '@/containers/Accounts/withAccounts';
|
||||
import withAccountsTableActions from './withAccountsTableActions';
|
||||
import { transformAccountsStateToQuery } from './utils';
|
||||
import { compose } from '@/utils';
|
||||
|
||||
/**
|
||||
* Accounts chart list.
|
||||
*/
|
||||
function AccountsChart({
|
||||
// #withAccounts
|
||||
accountsTableState,
|
||||
accountsTableStateChanged,
|
||||
|
||||
// #withAccountsActions
|
||||
resetAccountsTableState,
|
||||
}) {
|
||||
// Resets the accounts table state once the page unmount.
|
||||
useEffect(
|
||||
() => () => {
|
||||
resetAccountsTableState();
|
||||
},
|
||||
[resetAccountsTableState],
|
||||
);
|
||||
|
||||
return (
|
||||
<AccountsChartProvider
|
||||
query={transformAccountsStateToQuery(accountsTableState)}
|
||||
tableStateChanged={accountsTableStateChanged}
|
||||
>
|
||||
<AccountsActionsBar />
|
||||
|
||||
<DashboardPageContent>
|
||||
<AccountsViewsTabs />
|
||||
|
||||
<DashboardContentTable>
|
||||
<AccountsDataTable />
|
||||
</DashboardContentTable>
|
||||
</DashboardPageContent>
|
||||
</AccountsChartProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withAccounts(({ accountsTableState, accountsTableStateChanged }) => ({
|
||||
accountsTableState,
|
||||
accountsTableStateChanged,
|
||||
})),
|
||||
withAccountsTableActions,
|
||||
)(AccountsChart);
|
||||
Reference in New Issue
Block a user