// @ts-nocheck import React from 'react'; import { useHistory } from 'react-router-dom'; import { Button, NavbarGroup, Classes, NavbarDivider, Intent, } from '@blueprintjs/core'; import { usePaymentReceiveDetailContext } from './PaymentReceiveDetailProvider'; import withDialogActions from '@/containers/Dialog/withDialogActions'; import withAlertsActions from '@/containers/Alert/withAlertActions'; import withDrawerActions from '@/containers/Drawer/withDrawerActions'; import { PaymentReceiveMoreMenuItems } from './utils'; import { Can, Icon, FormattedMessage as T, DrawerActionsBar, } from '@/components'; import { PaymentReceiveAction, AbilitySubject, } from '@/constants/abilityOption'; import { compose } from '@/utils'; import { DRAWERS } from '@/constants/drawers'; /** * Payment receive actions bar. */ function PaymentReceiveActionsBar({ // #withAlertsActions openAlert, // #withDrawerActions closeDrawer, // #withDialogActions openDialog, }) { const history = useHistory(); // Retrieve the payment receive drawer context. const { paymentReceiveId } = usePaymentReceiveDetailContext(); // Handle edit payment receive. const handleEditPaymentReceive = () => { history.push(`/payment-receives/${paymentReceiveId}/edit`); closeDrawer(DRAWERS.PAYMENT_RECEIVE_DETAILS); }; // Handle delete payment receive. const handleDeletePaymentReceive = () => { openAlert('payment-receive-delete', { paymentReceiveId }); }; // Handle notify via SMS. const handleNotifyViaSMS = () => { openDialog('notify-payment-via-sms', { paymentReceiveId }); }; // Handle print payment receive. const handlePrintPaymentReceive = () => { openDialog('payment-pdf-preview', { paymentReceiveId }); }; return (