'use strict';

var jsxRuntime = require('react/jsx-runtime');
var React = require('react');
var formik = require('formik');
var Button = require('../Button-Bt_AElge.js');
var utils = require('../utils-CTr7wn5d.js');
var formik_Button = require('./Button.js');
require('../renderIcon-fLF3odqg.js');
require('../primitives/Button.js');
require('../button-B8XGl69v.js');
require('../index-BZhTddX0.js');
require('../index-DuNgWCXZ.js');
require('../index-D-iDn9RI.js');
require('../primitives/Spinner.js');
require('react-i18next');
require('../loader-circle-Bw7zP2Gn.js');
require('../createLucideIcon-D0tRgV6l.js');
require('../primitives/Tooltip.js');
require('../tooltip-C-568jEL.js');
require('../index-COPkC3I5.js');
require('../index-CGUGhyIp.js');
require('../index-Bvu9MiFi.js');
require('../index-DMbj7vXd.js');
require('react-dom');
require('../index-lWVw05cs.js');
require('../index-BwAq9ba8.js');
require('../index-CCdG4z4E.js');
require('../index-C9ICrOhM.js');
require('../floating-ui.react-dom-B4Aw6O7R.js');
require('../index-Bf0WsHta.js');
require('../index-Df-Ffa3s.js');
require('../index-DcCSSgb7.js');
require('../index-CyrAgb4H.js');
require('../index-CB9xFokC.js');
require('ramda');

const FormikActionBlock = React.forwardRef(({ className, submitButtonProps, cancelButtonProps, isSubmitting: isSubmittingProp, position = "left", }, ref) => {
    const { handleReset, isSubmitting: isFormikSubmitting } = formik.useFormikContext();
    const isSubmitting = isSubmittingProp ?? isFormikSubmitting;
    const cancelButton = (jsxRuntime.jsx(Button.Button, { "data-testid": "cancel-button", disabled: isSubmitting, label: "Cancel", variant: "ghost", onClick: handleReset, onMouseDown: (e) => e.preventDefault(), ...cancelButtonProps }));
    const submitButton = (jsxRuntime.jsx(formik_Button.FormikButton, { "data-testid": "save-changes-button", label: "Save changes", type: "submit", ...submitButtonProps }));
    return (jsxRuntime.jsx("div", { ref: ref, className: utils.cn("flex items-center gap-2", position === "right" && "justify-end", className), children: position === "right" ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [cancelButton, submitButton] })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [submitButton, cancelButton] })) }));
});
FormikActionBlock.displayName = "FormikActionBlock";

exports.FormikActionBlock = FormikActionBlock;
//# sourceMappingURL=ActionBlock.js.map
