// @ts-nocheck import React, { useRef } from 'react'; import intl from 'react-intl-universal'; import { Button } from '@blueprintjs/core'; import * as R from 'ramda'; import { useFormikContext } from 'formik'; import { ExchangeRateInputGroup } from '@/components'; import { useCurrentOrganization } from '@/hooks/state'; import { useEstimateIsForeignCustomer, useEstimateTotals } from './utils'; import { transactionNumber } from '@/utils'; import { useUpdateEffect } from '@/hooks'; import withSettings from '@/containers/Settings/withSettings'; import { useSyncExRateToForm, withExchangeRateFetchingLoading, withExchangeRateItemEntriesPriceRecalc, } from '@/containers/Entries/withExRateItemEntriesPriceRecalc'; import withDialogActions from '@/containers/Dialog/withDialogActions'; import { DialogsName } from '@/constants/dialogs'; /** * Estimate exchange rate input field. * @returns {JSX.Element} */ function EstimateExchangeRateInputFieldRoot({ ...props }) { const currentOrganization = useCurrentOrganization(); const { values } = useFormikContext(); const isForeignCustomer = useEstimateIsForeignCustomer(); // Can't continue if the customer is not foreign. if (!isForeignCustomer) { return null; } return ( ); } /** * Renders the estimate exchange rate input field with exchange rate * with item entries price re-calc once exchange rate change. * @returns {JSX.Element} */ export const EstimateExchangeRateInputField = R.compose( withExchangeRateFetchingLoading, withExchangeRateItemEntriesPriceRecalc, )(EstimateExchangeRateInputFieldRoot); /** * Estimate project select. * @returns {JSX.Element} */ export function EstimateProjectSelectButton({ label }) { return