import React from 'react'; import { useHistory } from 'react-router-dom'; import { Button, NavbarGroup, Classes, NavbarDivider, Intent, } from '@blueprintjs/core'; import { useBillDrawerContext } from './BillDrawerProvider'; import withDialogActions from 'containers/Dialog/withDialogActions'; import withAlertsActions from 'containers/Alert/withAlertActions'; import withDrawerActions from 'containers/Drawer/withDrawerActions'; import { Can, If, Icon, DrawerActionsBar, FormattedMessage as T, } from 'components'; import { BillAction, PaymentMadeAction, AbilitySubject, } from '../../../common/abilityOption'; import { safeCallback, compose } from 'utils'; function BillDetailActionsBar({ // #withDialogActions openDialog, // #withAlertsActions openAlert, // #withDrawerActions closeDrawer, }) { const history = useHistory(); const { billId, bill } = useBillDrawerContext(); // Handle edit bill. const onEditBill = () => { history.push(`/bills/${billId}/edit`); closeDrawer('bill-drawer'); }; // Handle delete bill. const onDeleteBill = () => { openAlert('bill-delete', { billId }); }; // Handle quick bill payment . const handleQuickBillPayment = () => { openDialog('quick-payment-made', { billId }); }; return (