mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
38 lines
1008 B
JavaScript
38 lines
1008 B
JavaScript
import React from 'react';
|
|
import * as R from 'ramda';
|
|
|
|
import { FinancialReportBody } from '../FinancialReportPage';
|
|
import { FinancialSheetSkeleton } from '../../../components/FinancialSheet';
|
|
import PurchasesByItemsTable from './PurchasesByItemsTable';
|
|
|
|
import { usePurchaseByItemsContext } from './PurchasesByItemsProvider';
|
|
|
|
import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
|
|
|
|
/**
|
|
* Purchases by items.
|
|
* @returns {JSX.Element}
|
|
*/
|
|
function PurchasesByItemsBodyJSX({
|
|
// #withPreferences
|
|
organizationName,
|
|
}) {
|
|
const { isLoading } = usePurchaseByItemsContext();
|
|
|
|
return (
|
|
<FinancialReportBody>
|
|
{isLoading ? (
|
|
<FinancialSheetSkeleton />
|
|
) : (
|
|
<PurchasesByItemsTable companyName={organizationName} />
|
|
)}
|
|
</FinancialReportBody>
|
|
);
|
|
}
|
|
|
|
export const PurchasesByItemsBody = R.compose(
|
|
withCurrentOrganization(({ organization }) => ({
|
|
organizationName: organization.name,
|
|
})),
|
|
)(PurchasesByItemsBodyJSX);
|