mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
20 lines
448 B
JavaScript
20 lines
448 B
JavaScript
import React from 'react';
|
|
|
|
import { dynamicColumns } from './dynamicColumns';
|
|
import { useProfitLossSheetContext } from './ProfitLossProvider';
|
|
|
|
/**
|
|
* Retrieves the profit/loss table columns.
|
|
* @returns
|
|
*/
|
|
export const useProfitLossSheetColumns = () => {
|
|
const {
|
|
profitLossSheet: { table },
|
|
} = useProfitLossSheetContext();
|
|
|
|
return React.useMemo(
|
|
() => dynamicColumns(table.columns || [], table.rows || []),
|
|
[table],
|
|
);
|
|
};
|