mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat(financial reports): add branch multi select.
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import React from 'react';
|
||||
|
||||
import { useBranches } from 'hooks/query';
|
||||
import { FinancialHeaderLoadingSkeleton } from '../FinancialHeaderLoadingSkeleton';
|
||||
|
||||
const CashFlowStatementDimensionsPanelContext = React.createContext();
|
||||
|
||||
/**
|
||||
* cash flow statement dimensions panel provider.
|
||||
* @returns
|
||||
*/
|
||||
function CashFlowStatementDimensionsPanelProvider({ ...props }) {
|
||||
// Fetches the branches list.
|
||||
const { isLoading: isBranchesLoading, data: branches } = useBranches();
|
||||
|
||||
// Provider
|
||||
const provider = {
|
||||
branches,
|
||||
isBranchesLoading,
|
||||
};
|
||||
return isBranchesLoading ? (
|
||||
<FinancialHeaderLoadingSkeleton />
|
||||
) : (
|
||||
<CashFlowStatementDimensionsPanelContext.Provider
|
||||
value={provider}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const useCashFlowStatementDimensionsPanelContext = () =>
|
||||
React.useContext(CashFlowStatementDimensionsPanelContext);
|
||||
|
||||
export {
|
||||
CashFlowStatementDimensionsPanelProvider,
|
||||
useCashFlowStatementDimensionsPanelContext,
|
||||
};
|
||||
Reference in New Issue
Block a user