@adaptabletools/adaptable
Version:
Powerful AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements
17 lines (16 loc) • 841 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { useSelector } from 'react-redux';
import { useAdaptable } from '../AdaptableContext';
import { Box } from '../../components/Flex';
import { SingleSelect } from '../../components/NewSelect';
export const LayoutStatusbar = () => {
const adaptable = useAdaptable();
const layouts = adaptable.api.layoutApi.getLayouts();
const options = layouts.map((layout) => ({ label: layout.Name, value: layout.Name }));
const currentLayout = useSelector((state) => state.Layout.CurrentLayout);
return (_jsx(Box, { onClick: (event) => {
event.stopPropagation();
}, children: _jsx(SingleSelect, { size: "small", items: options, value: currentLayout, onValueChange: (value) => {
adaptable.api.layoutApi.setLayout(value);
} }) }));
};