"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MapMenu = void 0;
var tslib_1 = require("tslib");
var React = tslib_1.__importStar(require("react"));
/**
 * The MapMenu component provides the ability to switch between active maps
 * @param props
 */
var MapMenu = function (props) {
    var _a = React.useState(undefined), selected = _a[0], setSelected = _a[1];
    var onActiveMapChanged = function (e) {
        var _a;
        var value = e.currentTarget.value;
        setSelected(value);
        (_a = props.onActiveMapChanged) === null || _a === void 0 ? void 0 : _a.call(props, value);
    };
    return React.createElement("div", null, props.maps.map(function (layer) {
        return React.createElement("div", { className: "map-menu-item-container", key: "base-layer-".concat(layer.mapName) },
            React.createElement("label", { className: "bp3-control bp3-radio" },
                React.createElement("input", { className: "map-menu-option", type: "radio", value: layer.mapName, checked: layer.mapName === props.selectedMap, onChange: onActiveMapChanged }),
                React.createElement("span", { className: "bp3-control-indicator" }),
                layer.label));
    }));
};
exports.MapMenu = MapMenu;
//# sourceMappingURL=map-menu.js.map