"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LayoutStatusbar = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const react_redux_1 = require("react-redux");
const Select_1 = require("../../components/Select");
const AdaptableContext_1 = require("../AdaptableContext");
const Flex_1 = require("../../components/Flex");
const LayoutStatusbar = () => {
    const adaptable = (0, AdaptableContext_1.useAdaptable)();
    const layouts = adaptable.api.layoutApi.getLayouts();
    const options = layouts.map((layout) => ({ label: layout.Name, value: layout.Name }));
    const currentLayout = (0, react_redux_1.useSelector)((state) => state.Layout.CurrentLayout);
    return (React.createElement(Flex_1.Box, { onClick: (event) => {
            event.stopPropagation();
        } },
        React.createElement(Select_1.Select, { size: "small", options: options, value: currentLayout, onChange: (value) => {
                adaptable.api.layoutApi.setLayout(value);
            } })));
};
exports.LayoutStatusbar = LayoutStatusbar;
