import React from 'react';
import moment from 'moment';
import { Link } from 'react-router-dom';
import { useAccountDrawerContext } from './AccountDrawerProvider';
import intl from 'react-intl-universal';
import { DataTable, Money } from 'components';
import { isBlank, compose } from 'utils';
import withDrawerActions from 'containers/Drawer/withDrawerActions';
/**
* account drawer table.
*/
function AccountDrawerTable({ closeDrawer }) {
const {
account: { currency_code },
accounts,
drawerName,
} = useAccountDrawerContext();
const columns = React.useMemo(
() => [
{
Header: intl.get('transaction_date'),
accessor: ({ date }) => moment(date).format('YYYY MMM DD'),
width: 110,
},
{
Header: intl.get('transaction_type'),
accessor: 'reference_type_formatted',
width: 100,
},
{
Header: intl.get('credit'),
accessor: ({ credit }) =>
!isBlank(credit) && credit !== 0 ? (