"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.usePredicateDef = void 0;
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const usePredicateDef = (operator, qlPredicateDefs) => {
    const predicateDef = react_1.default.useMemo(() => {
        if (!operator) {
            return null;
        }
        return qlPredicateDefs.find((predicateDef) => predicateDef.operator === operator) ?? null;
    }, [operator]);
    return predicateDef;
};
exports.usePredicateDef = usePredicateDef;
