mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
refactor(VendorTransaction). refactor(VendorBalanceSummary). refactor(CustomerBalanceSummary)
38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import * as R from 'ramda';
|
|
|
|
import { useVendorsTransactionsContext } from './VendorsTransactionsProvider';
|
|
|
|
import { FinancialReportBody } from '../FinancialReportPage';
|
|
import { FinancialSheetSkeleton } from '../../../components/FinancialSheet';
|
|
import VendorsTransactionsTable from './VendorsTransactionsTable';
|
|
|
|
import withCurrentOrganization from '../../../containers/Organization/withCurrentOrganization';
|
|
|
|
/**
|
|
* Vendors transactions body.
|
|
* @returns {JSX.Element}
|
|
*/
|
|
function VendorsTransactionsBodyJSX({
|
|
// #withPreferences
|
|
organizationName,
|
|
}) {
|
|
const { isVendorsTransactionsLoading } = useVendorsTransactionsContext();
|
|
|
|
return (
|
|
<FinancialReportBody>
|
|
{isVendorsTransactionsLoading ? (
|
|
<FinancialSheetSkeleton />
|
|
) : (
|
|
<VendorsTransactionsTable companyName={organizationName} />
|
|
)}
|
|
</FinancialReportBody>
|
|
);
|
|
}
|
|
|
|
export const VendorsTransactionsBody = R.compose(
|
|
withCurrentOrganization(({ organization }) => ({
|
|
organizationName: organization.name,
|
|
})),
|
|
)(VendorsTransactionsBodyJSX);
|