UNPKG

@adaptabletools/adaptable

Version:

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

18 lines (17 loc) 819 B
import * as React from 'react'; import { useSelector } from 'react-redux'; import { Box } from 'rebass'; import { Select } from '../../components/Select'; import { useAdaptable } from '../AdaptableContext'; 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 (React.createElement(Box, { onClick: (event) => { event.stopPropagation(); } }, React.createElement(Select, { size: "small", options: options, value: currentLayout, onChange: (value) => { adaptable.api.layoutApi.setLayout(value); } }))); };