import React from 'react'; import Icon from 'components/Icon'; import { Button, Classes, NavbarGroup, Intent, NavbarDivider, } from '@blueprintjs/core'; import { Can, FormattedMessage as T } from 'components'; import { AccountAction, AbilitySubject } from '../../../common/abilityOption'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'; import withDialogActions from 'containers/Dialog/withDialogActions'; import withAlertsActions from 'containers/Alert/withAlertActions'; import { AccountDialogAction } from 'containers/Dialogs/AccountDialog/utils'; import { useAccountDrawerContext } from './AccountDrawerProvider'; import { compose, safeCallback } from 'utils'; /** * Account drawer action bar. */ function AccountDrawerActionBar({ // #withDialog openDialog, // #withAlertsDialog openAlert, }) { // Account drawer context. const { account } = useAccountDrawerContext(); // Handle new child button click. const onNewChildAccount = () => { openDialog('account-form', { action: AccountDialogAction.NewChild, parentAccountId: account.id, accountType: account.account_type, }); }; // Handle edit account action. const onEditAccount = () => { openDialog('account-form', { action: AccountDialogAction.Edit, id: account.id, }); }; // Handle delete action account. const onDeleteAccount = () => { openAlert('account-delete', { accountId: account.id }); }; return (