"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExpressionEditUI = void 0;
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = tslib_1.__importDefault(require("react"));
const StyledButton_1 = require("../../../CommonUI/BuildlingBlocks/StyledButton");
const DataTypePicker_1 = require("../../../CommonUI/DataTypePicker");
const ExpressionEditLayer_1 = require("../../../Expressions/ExpressionEditLayer");
const ExpressionEditUI = ({ expression }) => {
    const [open, setOpen] = react_1.default.useState(false);
    return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledButton_1.StyledButton, { color: "primary", variant: "contained", onClick: () => setOpen(true), children: "Edit Expression" }), (0, jsx_runtime_1.jsx)(DataTypePicker_1.DataTypePicker, { dataDef: expression.getRuleResult(), width: "150px", label: "Expression Result:", updateCallback: (newDef) => {
                    expression.executionResult = newDef;
                } }), (0, jsx_runtime_1.jsx)(ExpressionEditLayer_1.ExpressionEditLayer, { expression: expression, open: open, onClose: () => setOpen(false) })] }));
};
exports.ExpressionEditUI = ExpressionEditUI;
//# sourceMappingURL=ExpressionEditUI.js.map