mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
import React from 'react';
|
|
import { useFormikContext } from 'formik';
|
|
|
|
import { Button, Classes, Intent } from '@blueprintjs/core';
|
|
import { FormattedMessage as T } from 'react-intl';
|
|
import { useExchangeRateFromContext } from './ExchangeRateFormProvider';
|
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
|
import { compose } from 'utils';
|
|
|
|
function ExchangeRateFormFooter({
|
|
// #withDialogActions
|
|
closeDialog,
|
|
}) {
|
|
const { isSubmitting } = useFormikContext();
|
|
const { dialogName, action } = useExchangeRateFromContext();
|
|
|
|
const handleClose = () => {
|
|
closeDialog(dialogName);
|
|
};
|
|
|
|
return (
|
|
<div className={Classes.DIALOG_FOOTER}>
|
|
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
|
<Button onClick={handleClose}>
|
|
<T id={'close'} />
|
|
</Button>
|
|
<Button intent={Intent.PRIMARY} type="submit" disabled={isSubmitting}>
|
|
{action === 'edit' ? <T id={'edit'} /> : <T id={'submit'} />}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default compose(withDialogActions)(ExchangeRateFormFooter);
|