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 withEstimatesActions from './withEstimatesActions'; import { useEstimatesListContext } from './EstimatesListProvider'; import { compose } from 'utils'; /** * Estimates list actions bar. */ function EstimateActionsBar({ // #withEstimateActions setEstimatesTableState, }) { const history = useHistory(); const { formatMessage } = useIntl(); const [filterCount, setFilterCount] = useState(0); // Estimates list context. const { estimatesViews } = useEstimatesListContext(); // Handle click a new sale estimate. const onClickNewEstimate = () => { history.push('/estimates/new'); }; // Handle tab change. const handleTabChange = (customView) => { setEstimatesTableState({ customViewId: customView.id || null, }); }; return (