// @ts-nocheck import React, { useCallback, useState, useMemo } from 'react'; import intl from 'react-intl-universal'; import classNames from 'classnames'; import { NavbarGroup, NavbarDivider, Button, Classes, Intent, Popover, Position, PopoverInteractionKind, Alignment, } from '@blueprintjs/core'; import { Icon, If, DashboardActionsBar, FormattedMessage as T, } from '@/components'; import { connect } from 'react-redux'; import { useRefreshExchangeRate } from '@/hooks/query/exchangeRates'; import withDialogActions from '@/containers/Dialog/withDialogActions'; import withResourceDetail from '@/containers/Resources/withResourceDetails'; import withExchangeRatesActions from './withExchangeRatesActions'; import { compose } from '@/utils'; /** * Exchange rate actions bar. */ function ExchangeRateActionsBar({ // #withDialogActions. openDialog, // #withResourceDetail resourceFields, //#withExchangeRatesActions addExchangeRatesTableQueries, // #ownProps selectedRows = [], onDeleteExchangeRate, onFilterChanged, onBulkDelete, }) { const [filterCount, setFilterCount] = useState(0); const onClickNewExchangeRate = () => { openDialog('exchangeRate-form', {}); }; // Exchange rates refresh action. const { refresh } = useRefreshExchangeRate(); // Handle click a refresh sale estimates const handleRefreshBtnClick = () => { refresh(); }; const hasSelectedRows = useMemo( () => selectedRows.length > 0, [selectedRows], ); const handelBulkDelete = useCallback(() => { onBulkDelete && onBulkDelete(selectedRows.map((r) => r.id)); }, [onBulkDelete, selectedRows]); return (