mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
import React from 'react';
|
|
import { DataTable, Card } from 'components';
|
|
|
|
import '../../../../style/pages/RefundCreditNote/List.scss';
|
|
|
|
import withAlertsActions from 'containers/Alert/withAlertActions';
|
|
import { useVendorCreditDetailDrawerContext } from '../VendorCreditDetailDrawerProvider';
|
|
import {
|
|
useReconcileVendorCreditTransactionsTableColumns,
|
|
ActionsMenu,
|
|
} from './components';
|
|
import { compose } from 'utils';
|
|
|
|
/**
|
|
* Reconcile vendor credit transactions table.
|
|
*/
|
|
function ReconcileVendorCreditTransactionsTable({
|
|
// #withAlertsActions
|
|
openAlert,
|
|
}) {
|
|
const columns = useReconcileVendorCreditTransactionsTableColumns();
|
|
|
|
const { reconcileVendorCredits } = useVendorCreditDetailDrawerContext();
|
|
|
|
// Handle delete reconile credit.
|
|
const handleDeleteReconcileVendorCredit = ({ id }) => {
|
|
openAlert('reconcile-vendor-delete', { vendorCreditId: id });
|
|
};
|
|
|
|
return (
|
|
<Card>
|
|
<DataTable
|
|
columns={columns}
|
|
data={reconcileVendorCredits}
|
|
ContextMenu={ActionsMenu}
|
|
payload={{
|
|
onDelete: handleDeleteReconcileVendorCredit,
|
|
}}
|
|
className={'datatable--refund-transactions'}
|
|
/>
|
|
</Card>
|
|
);
|
|
}
|
|
|
|
export default compose(withAlertsActions)(
|
|
ReconcileVendorCreditTransactionsTable,
|
|
);
|