UNPKG

@doreamonjs/gate

Version:
25 lines 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const react_1 = tslib_1.__importStar(require("react")); const dva_1 = require("dva"); const antd_1 = require("antd"); require("./index.less"); class Env extends react_1.Component { render() { const { value, options, onChange } = this.props; return (react_1.default.createElement(antd_1.Select, { className: 'env', // showArrow={false} value: value, onChange: onChange }, options.map((option) => (react_1.default.createElement(antd_1.Select.Option, { key: option.value, value: option.value }, option.label))))); } } const mapState = ({ configs }) => { const { env: value, docs } = configs || {}; const options = docs.env || []; return { value, options }; }; const mapActions = (dispatch) => ({ onChange: (env) => dispatch({ type: 'configs/set/env', payload: env }), }); exports.default = dva_1.connect(mapState, mapActions)(Env); //# sourceMappingURL=env.js.map