refactor(InventoryValuation).

refactor(InventoryItemDetails).
This commit is contained in:
a.bouhuolia
2022-02-12 17:03:15 +02:00
parent 72a7c4890e
commit 46570c5218
7 changed files with 155 additions and 56 deletions

View File

@@ -0,0 +1,36 @@
import React from 'react';
import * as R from 'ramda';
import { useInventoryItemDetailsContext } from './InventoryItemDetailsProvider';
import { InventoryItemDetailsTable } from './InventoryItemDetailsTable';
import { FinancialReportBody } from '../FinancialReportPage';
import { FinancialSheetSkeleton } from '../../../components/FinancialSheet';
import withCurrentOrganization from 'containers/Organization/withCurrentOrganization';
/**
* Inventory item details body.
* @returns {JSX.Element}
*/
function InventoryItemDetailsBodyJSX({
// #withCurrentOrganization
organizationName,
}) {
const { isInventoryItemDetailsLoading } = useInventoryItemDetailsContext();
return (
<FinancialReportBody>
{isInventoryItemDetailsLoading ? (
<FinancialSheetSkeleton />
) : (
<InventoryItemDetailsTable companyName={organizationName} />
)}
</FinancialReportBody>
);
}
export const InventoryItemDetailsBody = R.compose(
withCurrentOrganization(({ organization }) => ({
organizationName: organization.name,
})),
)(InventoryItemDetailsBodyJSX);