import { jsx as _jsx } from "react/jsx-runtime";
import { TreeRuleNodeType } from "../Structure/TreeRuleNode";
import { MissingRuleNode } from "./MissingRuleNode";
import { EvaluationNode } from "./EvaluationNode";
import { ResultRuleNode } from "./ResultRuleNode";
import { ObserveMultiState } from "../../../CommonUI/StateManagement/ObserveMultiState";
export const XTreeRuleNode = (props) => {
    const { node, ruleDefinition } = props;
    return (_jsx(ObserveMultiState, { listenTo: [ruleDefinition, node], control: () => {
            if (!node)
                return null;
            switch (node.nodeType) {
                case TreeRuleNodeType.EVALUATION:
                    return _jsx(EvaluationNode, Object.assign({}, props), void 0);
                case TreeRuleNodeType.UNDEFINED:
                    return _jsx(MissingRuleNode, Object.assign({}, props), void 0);
                case TreeRuleNodeType.RESULT:
                    return _jsx(ResultRuleNode, Object.assign({}, props), void 0);
                default:
                    return null;
            }
        } }, void 0));
};
//# sourceMappingURL=XTreeRuleNode.js.map