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