mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat: estimate tooltip.
This commit is contained in:
@@ -1,47 +1,74 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { FormatNumberCell } from '../../../components';
|
import { FormatNumberCell, TextOverviewTooltipCell } from '../../../components';
|
||||||
|
import { getColumnWidth } from 'utils';
|
||||||
|
import { useEstimateDetailDrawerContext } from './EstimateDetailDrawerProvider';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve table columns of estimate readonly entries details.
|
* Retrieve table columns of estimate readonly entries details.
|
||||||
*/
|
*/
|
||||||
export const useEstimateReadonlyEntriesColumns = () =>
|
export const useEstimateReadonlyEntriesColumns = () => {
|
||||||
React.useMemo(() => [
|
// estimate details drawer context.
|
||||||
{
|
const {
|
||||||
Header: intl.get('product_and_service'),
|
estimate: { entries },
|
||||||
accessor: 'item.name',
|
} = useEstimateDetailDrawerContext();
|
||||||
width: 150,
|
|
||||||
className: 'name',
|
return React.useMemo(
|
||||||
disableSortBy: true,
|
() => [
|
||||||
},
|
{
|
||||||
{
|
Header: intl.get('product_and_service'),
|
||||||
Header: intl.get('description'),
|
accessor: 'item.name',
|
||||||
accessor: 'description',
|
Cell: TextOverviewTooltipCell,
|
||||||
className: 'description',
|
width: 150,
|
||||||
disableSortBy: true,
|
className: 'name',
|
||||||
},
|
disableSortBy: true,
|
||||||
{
|
textOverview: true,
|
||||||
Header: intl.get('quantity'),
|
},
|
||||||
accessor: 'quantity',
|
{
|
||||||
Cell: FormatNumberCell,
|
Header: intl.get('description'),
|
||||||
width: 100,
|
accessor: 'description',
|
||||||
align: 'right',
|
Cell: TextOverviewTooltipCell,
|
||||||
disableSortBy: true,
|
className: 'description',
|
||||||
},
|
disableSortBy: true,
|
||||||
{
|
textOverview: true,
|
||||||
Header: intl.get('rate'),
|
},
|
||||||
accessor: 'rate',
|
{
|
||||||
Cell: FormatNumberCell,
|
Header: intl.get('quantity'),
|
||||||
width: 100,
|
accessor: 'quantity',
|
||||||
align: 'right',
|
Cell: FormatNumberCell,
|
||||||
disableSortBy: true,
|
width: getColumnWidth(entries, 'quantity', {
|
||||||
},
|
minWidth: 60,
|
||||||
{
|
magicSpacing: 5,
|
||||||
Header: intl.get('amount'),
|
}),
|
||||||
accessor: 'amount',
|
align: 'right',
|
||||||
Cell: FormatNumberCell,
|
disableSortBy: true,
|
||||||
width: 100,
|
textOverview: true,
|
||||||
align: 'right',
|
},
|
||||||
disableSortBy: true,
|
{
|
||||||
},
|
Header: intl.get('rate'),
|
||||||
], []);
|
accessor: 'rate',
|
||||||
|
Cell: FormatNumberCell,
|
||||||
|
width: getColumnWidth(entries, 'rate', {
|
||||||
|
minWidth: 60,
|
||||||
|
magicSpacing: 5,
|
||||||
|
}),
|
||||||
|
align: 'right',
|
||||||
|
disableSortBy: true,
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Header: intl.get('amount'),
|
||||||
|
accessor: 'amount',
|
||||||
|
Cell: FormatNumberCell,
|
||||||
|
width: getColumnWidth(entries, 'amount', {
|
||||||
|
minWidth: 60,
|
||||||
|
magicSpacing: 5,
|
||||||
|
}),
|
||||||
|
align: 'right',
|
||||||
|
disableSortBy: true,
|
||||||
|
textOverview: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
[],
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user