"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DataSetStatusPanelPopover = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const SelectList_1 = require("../../components/SelectList");
const AdaptableContext_1 = require("../AdaptableContext");
const DataSetStatusPanelPopover = () => {
    const adaptable = (0, AdaptableContext_1.useAdaptable)();
    const dataSets = adaptable.api.dataSetApi.getDataSets();
    const handleDataSetChange = React.useCallback((option) => {
        adaptable.api.dataSetApi.setDataSet(option.label);
    }, []);
    const options = dataSets.map((dataSet) => ({
        label: dataSet.name,
        value: dataSet.name,
    }));
    return React.createElement(SelectList_1.SelectList, { options: options, onChange: handleDataSetChange });
};
exports.DataSetStatusPanelPopover = DataSetStatusPanelPopover;
