import React from 'react'; import { Intent, Position, Button, Tooltip } from '@blueprintjs/core'; import { FormattedMessage as T } from 'components'; import { Icon, Money, Hint } from 'components'; import intl from 'react-intl-universal'; import { AccountsListFieldCell, MoneyFieldCell, InputGroupCell, ContactsListFieldCell, } from 'components/DataTableCells'; import { safeSumBy } from 'utils'; /** * Contact header cell. */ export function ContactHeaderCell() { return ( <> } position={Position.LEFT_BOTTOM} /> ); } /** * Credit header cell. */ export function CreditHeaderCell({ payload: { currencyCode } }) { return intl.get('credit_currency', { currency: currencyCode }); } /** * debit header cell. */ export function DebitHeaderCell({ payload: { currencyCode } }) { return intl.get('debit_currency', { currency: currencyCode }); } /** * Account footer cell. */ function AccountFooterCell({ payload: { currencyCode } }) { return ( {intl.get('total_currency', { currency: currencyCode })} ); } /** * Total credit table footer cell. */ function TotalCreditFooterCell({ payload: { currencyCode }, rows }) { const credit = safeSumBy(rows, 'original.credit'); return ( ); } /** * Total debit table footer cell. */ function TotalDebitFooterCell({ payload: { currencyCode }, rows }) { const debit = safeSumBy(rows, 'original.debit'); return ( ); } /** * Actions cell renderer. */ export const ActionsCellRenderer = ({ row: { index }, column: { id }, cell: { value: initialValue }, data, payload, }) => { const onClickRemoveRole = () => { payload.removeRow(index); }; return ( } position={Position.LEFT}>