"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "OrderEditFormSheet", {
    enumerable: true,
    get: function() {
        return OrderEditFormSheet;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _modal = require("../../../../modal");
const _editorForm = require("./editorForm");
const OrderEditFormSheet = (props)=>{
    const { hide, resolve, reject } = (0, _modal.useModal)();
    if (!props.order) {
        return null;
    }
    const onEditSubmit = (values)=>{
        return props.editOrder(values).then((res)=>{
            if (res.success) {
                // toast.success("Order placed successfully");
                resolve(res);
                hide();
            // props.onComplete?.(res.data);
            }
        });
    };
    return /*#__PURE__*/ (0, _jsxruntime.jsx)(_editorForm.OrderEditForm, {
        order: props.order,
        onSubmit: onEditSubmit,
        onCancel: function() {
            reject();
            hide();
        }
    });
};

//# sourceMappingURL=editorSheet.js.map