mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat: optimize style of credit note details. feat: optimize global style checkbox of the application.
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
import React from 'react';
|
|
import { DataTable, Card } from 'components';
|
|
|
|
import { TableStyle } from 'common';
|
|
import withAlertsActions from 'containers/Alert/withAlertActions';
|
|
|
|
import { useCreditNoteDetailDrawerContext } from '../CreditNoteDetailDrawerProvider';
|
|
import {
|
|
useRefundCreditTransactionsTableColumns,
|
|
ActionsMenu,
|
|
} from './components';
|
|
|
|
import { compose } from 'utils';
|
|
|
|
/**
|
|
* Refund credit note transactions table.
|
|
*/
|
|
function RefundCreditNoteTransactionsTable({
|
|
// #withAlertsActions
|
|
openAlert,
|
|
}) {
|
|
const { refundCreditNote } = useCreditNoteDetailDrawerContext();
|
|
|
|
// Refund credit transactions table columns.
|
|
const columns = useRefundCreditTransactionsTableColumns();
|
|
|
|
// Handle delete refund credit.
|
|
const handleDeleteRefundCreditNote = ({ id }) => {
|
|
openAlert('refund-credit-delete', { creditNoteId: id });
|
|
};
|
|
|
|
return (
|
|
<Card>
|
|
<DataTable
|
|
columns={columns}
|
|
data={refundCreditNote}
|
|
ContextMenu={ActionsMenu}
|
|
styleName={TableStyle.Constrant}
|
|
payload={{
|
|
onDelete: handleDeleteRefundCreditNote,
|
|
}}
|
|
/>
|
|
</Card>
|
|
);
|
|
}
|
|
|
|
export default compose(withAlertsActions)(RefundCreditNoteTransactionsTable);
|