chrone: sperate client and server to different repos.

This commit is contained in:
a.bouhuolia
2021-09-21 17:13:53 +02:00
parent e011b2a82b
commit 18df5530c7
10015 changed files with 17686 additions and 97524 deletions

View File

@@ -0,0 +1,64 @@
import React from 'react';
import { Button } from '@blueprintjs/core';
import { Icon, If } from 'components';
import { FormattedMessage as T } from 'components';
import { dynamicColumns } from './utils';
import { useCashFlowStatementContext } from './CashFlowStatementProvider';
import FinancialLoadingBar from '../FinancialLoadingBar';
/**
* Retrieve cash flow statement columns.
*/
export const useCashFlowStatementColumns = () => {
const {
cashFlowStatement: { columns, tableRows },
} = useCashFlowStatementContext();
return React.useMemo(
() => dynamicColumns(columns, tableRows),
[columns, tableRows],
);
};
/**
* Cash flow statement loading bar.
*/
export function CashFlowStatementLoadingBar() {
const { isCashFlowLoading } = useCashFlowStatementContext();
return (
<If condition={isCashFlowLoading}>
<FinancialLoadingBar />
</If>
);
}
/**
* Cash flow statement alter
*/
export function CashFlowStatementAlerts() {
const { cashFlowStatement, isCashFlowLoading, refetchCashFlow } =
useCashFlowStatementContext();
// Handle refetch the report sheet.
const handleRecalcReport = () => {
refetchCashFlow();
};
// Can't display any error if the report is loading
if (isCashFlowLoading) {
return null;
}
return (
<If condition={cashFlowStatement.meta.is_cost_compute_running}>
<div className="alert-compute-running">
<Icon icon="info-block" iconSize={12} />
<T id={'just_a_moment_we_re_calculating_your_cost_transactions'} />
<Button onClick={handleRecalcReport} minimal={true} small={true}>
<T id={'refresh'} />
</Button>
</div>
</If>
);
}