import React, { memo } from 'react';
import {
Position,
Classes,
Tooltip,
MenuItem,
Menu,
MenuDivider,
Intent,
Popover,
Button,
} from '@blueprintjs/core';
import { useIntl } from 'react-intl';
import { Icon, Money, If } from 'components';
import { formatMessage } from 'services/intl';
import { safeCallback } from 'utils';
/**
* Accounts table actions menu.
*/
export function ActionsMenu({
row: { original },
payload: {
onEdit,
onViewDetails,
onDelete,
onNewChild,
onActivate,
onInactivate,
},
}) {
return (
);
}
/**
* Actions cell.
*/
export function ActionsCell(props) {
return (
}
>
} />
);
}
/**
* Normal cell.
*/
export function NormalCell({ cell: { value } }) {
const { formatMessage } = useIntl();
const arrowDirection = value === 'credit' ? 'down' : 'up';
// Can't continue if the value is not `credit` or `debit`.
if (['credit', 'debit'].indexOf(value) === -1) {
return '';
}
return (
);
}
/**
* Balance cell.
*/
export function BalanceCell({ cell }) {
const account = cell.row.original;
return account.amount !== null ? (
) : (
—
);
}