"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AdaptableColumnFilter = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const ColumnFilter_1 = require("./ColumnFilter");
const useAdaptableFilterWrapper_1 = require("./useAdaptableFilterWrapper");
/**
 * This wrapper knows about predicates.
 * It transforms predicates in QlPredicates.
 */
const AdaptableColumnFilter = (props) => {
    const { qlPredicate, qlPredicateDefs, columnFilter, handlePredicateChange } = (0, useAdaptableFilterWrapper_1.useAdaptableFilterWrapper)(props.columnId, 'FilterForm');
    return (React.createElement(ColumnFilter_1.ColumnFilterComponent, { location: props.location, wrapperProps: props.wrapperProps, columnId: props.columnId, predicate: qlPredicate, predicateDefs: qlPredicateDefs, disabled: columnFilter?.IsSuspended, onPredicateChange: React.useCallback((predicate) => {
            handlePredicateChange(predicate);
        }, [handlePredicateChange]) }));
};
exports.AdaptableColumnFilter = AdaptableColumnFilter;
