mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
38 lines
995 B
JavaScript
38 lines
995 B
JavaScript
import React from 'react';
|
|
import * as R from 'ramda';
|
|
|
|
import { FinancialReportBody } from '../FinancialReportPage';
|
|
import APAgingSummaryTable from './APAgingSummaryTable';
|
|
import { FinancialSheetSkeleton } from '../../../components/FinancialSheet';
|
|
|
|
import withCurrentOrganization from '../../Organization/withCurrentOrganization';
|
|
|
|
import { useAPAgingSummaryContext } from './APAgingSummaryProvider';
|
|
|
|
/**
|
|
* AP aging summary body.
|
|
* @returns {JSX.Element}
|
|
*/
|
|
function APAgingSummaryBodyJSX({
|
|
// #withCurrentOrganization
|
|
organizationName,
|
|
}) {
|
|
const { isLoading } = useAPAgingSummaryContext();
|
|
|
|
return (
|
|
<FinancialReportBody>
|
|
{isLoading ? (
|
|
<FinancialSheetSkeleton />
|
|
) : (
|
|
<APAgingSummaryTable organizationName={organizationName} />
|
|
)}
|
|
</FinancialReportBody>
|
|
);
|
|
}
|
|
|
|
export const APAgingSummaryBody = R.compose(
|
|
withCurrentOrganization(({ organization }) => ({
|
|
organizationName: organization?.name,
|
|
})),
|
|
)(APAgingSummaryBodyJSX);
|