"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GridFilterStatusbar = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_redux_1 = require("react-redux");
const GridFilterStatusbar = (props) => {
    const queryMaxLength = 15;
    const currentLayoutName = (0, react_redux_1.useSelector)((state) => state.Layout.CurrentLayout);
    const currentLayout = (0, react_redux_1.useSelector)((state) => state.Layout.Layouts).find((layout) => layout.Name === currentLayoutName);
    const query = currentLayout?.GridFilter?.Expression ?? '';
    let text = query;
    let popover = null;
    if (query.length > queryMaxLength) {
        text = query.substring(0, queryMaxLength - 3) + '...';
        popover = query;
    }
    return React.createElement(React.Fragment, null, text ?? 'No Query');
};
exports.GridFilterStatusbar = GridFilterStatusbar;
