feat: integrate balance sheet and P&L sheet with new API.

This commit is contained in:
a.bouhuolia
2022-01-30 15:57:27 +02:00
parent fa455152a3
commit 3d78d2d051
13 changed files with 147 additions and 256 deletions

View File

@@ -0,0 +1,35 @@
import React from 'react';
import ProfitLossSheetTable from './ProfitLossSheetTable';
import { FinancialReportBody } from '../FinancialReportPage';
import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import { useProfitLossSheetContext } from './ProfitLossProvider';
import { compose } from 'utils';
/**
* @returns {React.JSX}
*/
function ProfitLossBodyJSX({
// #withPreferences
organizationName,
}) {
const { isLoading } = useProfitLossSheetContext();
return (
<FinancialReportBody>
{isLoading ? (
'loading'
) : (
<ProfitLossSheetTable companyName={organizationName} />
)}
</FinancialReportBody>
);
}
export const ProfitLossBody = compose(
withCurrentOrganization(({ organization }) => ({
organizationName: organization.name,
})),
)(ProfitLossBodyJSX);