/**
 * Created by baoyinghai on 5/31/17.
 */
import React from 'react';
import { Select } from '../../../../components/mxa';

const keyMap = {
  label: '标签',
  value: '值'
};

export default {
  getKeys: keys => Object.keys(keyMap),
  setFormItems: (key, setting, fields) => {
    return {
      key,
      label: keyMap[key],
      comp:(
        <Select>
          {fields.map(f => (<Option value={f}>{f}</Option>))}
        </Select>
      ),
      initData: setting[key] || key
    };
  }
}