/* eslint-disable no-unused-vars */
import React from 'react';
import { Form, Radio, InputNumber, Switch } from 'antd';
import { findValuesByNamePath } from '../../../../utils';
import './index.less';

export default ({ propValue, config, onChange }) => {
  const { name, label, ControlOptions = {} } = config;
  const { options = [] } = ControlOptions;
  const { effect, roate, stretch, depth } = findValuesByNamePath(
    name,
    propValue,
  );
  const labelCol = {
    span: 9,
  };
  const changValue = (e, names) => {
    onChange(names, e);
  };
  return (
    <Form.Item label={label}>
      <Radio.Group
        size="small"
        value={effect}
        onChange={e => changValue(e.target.value, name.effect)}
      >
        {options.map((item, index) => (
          <Radio.Button key={index.toString()} value={item.value}>
            {item.name}
          </Radio.Button>
        ))}
      </Radio.Group>
      {/* {effect === 'coverflow' && (
        <div className="draw-swiper-effect">
          <Form.Item
            label="w"
            labelCol={labelCol}
            className="draw-swiper-effect-item"
          >
            <InputNumber
              step={0.1}
              defaultValue={roate}
              onChange={e => changValue(e, name.roate)}
            />
          </Form.Item>
          <Form.Item
            label="m"
            labelCol={labelCol}
            className="draw-swiper-effect-item"
          >
            <InputNumber
              astep={0.1}
              defaultValue={stretch}
              onChange={e => changValue(e, name.stretch)}
            />
          </Form.Item>
          <Form.Item
            label="s"
            labelCol={labelCol}
            className="draw-swiper-effect-item"
          >
            <InputNumber
              step={0.1}
              defaultValue={depth}
              onChange={e => changValue(e, name.depth)}
            />
          </Form.Item>
        </div>
      )} */}
    </Form.Item>
  );
};
