UNPKG

@adaptabletools/adaptable

Version:

Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements

16 lines (15 loc) 681 B
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'); };