import * as React from 'react';
import { useSelector } from 'react-redux';
export const GridFilterStatusbar = (props) => {
    const queryMaxLength = 15;
    const currentLayoutName = useSelector((state) => state.Layout.CurrentLayout);
    const currentLayout = 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');
};
