import { jsx as _jsx } from "react/jsx-runtime";
import { useModal } from "../../../../modal";
import { OrderEditForm } from "./editorForm";
export const OrderEditFormSheet = (props)=>{
    const { hide, resolve, reject } = 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__*/ _jsx(OrderEditForm, {
        order: props.order,
        onSubmit: onEditSubmit,
        onCancel: function() {
            reject();
            hide();
        }
    });
};

//# sourceMappingURL=editorSheet.js.map