import React, { useCallback } from 'react'; import { NavbarGroup, NavbarDivider, Button, Classes, Intent, Popover, Position, PopoverInteractionKind, } from '@blueprintjs/core'; import { FormattedMessage as T, useIntl } from 'react-intl'; import classNames from 'classnames'; import { useHistory } from 'react-router-dom'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'; import { If, Icon, DashboardActionViewsList } from 'components'; import { useCustomersListContext } from './CustomersListProvider'; import withCustomers from './withCustomers'; import withCustomersActions from './withCustomersActions'; import withAlertActions from 'containers/Alert/withAlertActions'; import { compose } from 'utils'; /** * Customers actions bar. */ function CustomerActionsBar({ // #withCustomers customersSelectedRows = [], // #withCustomersActions setCustomersTableState, // #withAlertActions openAlert, }) { // History context. const history = useHistory(); // React intl const { formatMessage } = useIntl(); // Customers list context. const { customersViews } = useCustomersListContext(); const onClickNewCustomer = () => { history.push('/customers/new'); }; // Handle Customers bulk delete button click., const handleBulkDelete = () => { openAlert('customers-bulk-delete', { customersIds: customersSelectedRows }); }; const handleTabChange = (viewId) => { setCustomersTableState({ customViewId: viewId.id || null, }); }; return (