mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
52 lines
1.6 KiB
TypeScript
52 lines
1.6 KiB
TypeScript
// @ts-nocheck
|
|
import React from 'react';
|
|
|
|
import { DashboardPageContent } from '@/components';
|
|
import WarehouseTransfersActionsBar from './WarehouseTransfersActionsBar';
|
|
import WarehouseTransfersDataTable from './WarehouseTransfersDataTable';
|
|
import withWarehouseTransfers from './withWarehouseTransfers';
|
|
import withWarehouseTransfersActions from './withWarehouseTransfersActions';
|
|
|
|
import { WarehouseTransfersListProvider } from './WarehouseTransfersListProvider';
|
|
import { transformTableStateToQuery, compose } from '@/utils';
|
|
|
|
function WarehouseTransfersList({
|
|
// #withWarehouseTransfers
|
|
warehouseTransferTableState,
|
|
warehouseTransferTableStateChanged,
|
|
|
|
// #withWarehouseTransfersActions
|
|
resetWarehouseTransferTableState,
|
|
}) {
|
|
// Resets the warehouse transfer table state once the page unmount.
|
|
React.useEffect(
|
|
() => () => {
|
|
resetWarehouseTransferTableState();
|
|
},
|
|
[resetWarehouseTransferTableState],
|
|
);
|
|
|
|
return (
|
|
<WarehouseTransfersListProvider
|
|
query={transformTableStateToQuery(warehouseTransferTableState)}
|
|
tableStateChanged={warehouseTransferTableStateChanged}
|
|
>
|
|
<WarehouseTransfersActionsBar />
|
|
|
|
<DashboardPageContent>
|
|
<WarehouseTransfersDataTable />
|
|
</DashboardPageContent>
|
|
</WarehouseTransfersListProvider>
|
|
);
|
|
}
|
|
|
|
export default compose(
|
|
withWarehouseTransfersActions,
|
|
withWarehouseTransfers(
|
|
({ warehouseTransferTableState, warehouseTransferTableStateChanged }) => ({
|
|
warehouseTransferTableState,
|
|
warehouseTransferTableStateChanged,
|
|
}),
|
|
),
|
|
)(WarehouseTransfersList);
|