import React, { useState } from 'react'; import Icon from 'components/Icon'; import { Button, Classes, Popover, NavbarDivider, NavbarGroup, PopoverInteractionKind, Position, Intent, } from '@blueprintjs/core'; import classNames from 'classnames'; import { useHistory } from 'react-router-dom'; import { FormattedMessage as T, useIntl } from 'react-intl'; import { If, DashboardActionViewsList } from 'components'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'; import withReceiptsActions from './withReceiptsActions'; import { useReceiptsListContext } from './ReceiptsListProvider'; import { compose } from 'utils'; /** * Receipts actions bar. */ function ReceiptActionsBar({ // #withReceiptsActions setReceiptsTableState, }) { const history = useHistory(); const { formatMessage } = useIntl(); const [filterCount, setFilterCount] = useState(0); // Sale receipts list context. const { receiptsViews } = useReceiptsListContext(); // Handle new receipt button click. const onClickNewReceipt = () => { history.push('/receipts/new'); }; const handleTabChange = (customView) => { setReceiptsTableState({ customViewId: customView.id || null, }); }; return (