import React from 'react'; import { NavbarGroup, Button, Classes, NavbarDivider, Popover, Position, PopoverInteractionKind, } from '@blueprintjs/core'; import { FormattedMessage as T } from 'react-intl'; import classNames from 'classnames'; import Icon from 'components/Icon'; import DashboardActionsBar from 'components/Dashboard/DashboardActionsBar'; import NumberFormatDropdown from 'components/NumberFormatDropdown'; import withProfitLossActions from './withProfitLossActions'; import withProfitLoss from './withProfitLoss'; import { compose, saveInvoke } from 'utils'; import { useProfitLossSheetContext } from './ProfitLossProvider'; /** * Profit/Loss sheet actions bar. */ function ProfitLossActionsBar({ // #withProfitLoss profitLossDrawerFilter, // #withProfitLossActions toggleProfitLossFilterDrawer: toggleFilterDrawer, // #ownProps numberFormat, onNumberFormatSubmit, }) { const { sheetRefetch, isLoading } = useProfitLossSheetContext(); const handleFilterClick = () => { toggleFilterDrawer(); }; const handleRecalcReport = () => { sheetRefetch(); }; // Handle number format submit. const handleNumberFormatSubmit = (values) => { saveInvoke(onNumberFormatSubmit, values); }; return (