import _Range from "@alifd/next/es/range";
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["type", "prefix", "className", "style", "slider", "min", "max", "step", "value", "defaultValue", "marks", "marksPosition", "disabled", "hasTip", "reverse", "pure", "fixedWidth", "ifFixedWidth", "tooltipVisible", "disperse", "disperseValue", "rtl"];
/* eslint-disable @typescript-eslint/no-shadow */
import * as React from 'react';
import "./index.less";
// import InfiniteScroll from 'react-infinite-scroll-component';

var mySlider = function mySlider(_ref) {
  var type = _ref.type,
    prefix = _ref.prefix,
    className = _ref.className,
    style = _ref.style,
    slider = _ref.slider,
    min = _ref.min,
    max = _ref.max,
    step = _ref.step,
    value = _ref.value,
    defaultValue = _ref.defaultValue,
    marks = _ref.marks,
    marksPosition = _ref.marksPosition,
    disabled = _ref.disabled,
    hasTip = _ref.hasTip,
    reverse = _ref.reverse,
    pure = _ref.pure,
    fixedWidth = _ref.fixedWidth,
    ifFixedWidth = _ref.ifFixedWidth,
    tooltipVisible = _ref.tooltipVisible,
    disperse = _ref.disperse,
    disperseValue = _ref.disperseValue,
    rtl = _ref.rtl,
    otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
  var dan = function dan() {
    return disperse === '无' ? /*#__PURE__*/React.createElement(_Range, _extends({
      value: value,
      disabled: disabled,
      style: style
    }, otherProps)) : /*#__PURE__*/React.createElement(_Range, _extends({
      value: value,
      disabled: disabled,
      marks: disperseValue,
      style: style
    }, otherProps));
  };
  var shuang = function shuang() {
    return disperse === '无' ? ifFixedWidth ? /*#__PURE__*/React.createElement(_Range, _extends({
      fixedWidth: true,
      value: [value, defaultValue],
      defaultValue: [value, defaultValue],
      style: style
    }, otherProps)) : /*#__PURE__*/React.createElement(_Range, _extends({
      slider: "double",
      value: [value, defaultValue],
      defaultValue: [value, defaultValue],
      style: style
    }, otherProps)) : ifFixedWidth ? /*#__PURE__*/React.createElement(_Range, _extends({
      fixedWidth: true,
      value: [value, defaultValue],
      defaultValue: [value, defaultValue],
      disabled: disabled,
      marks: disperseValue,
      style: style
    }, otherProps)) : /*#__PURE__*/React.createElement(_Range, _extends({
      slider: "double",
      value: [value, defaultValue],
      defaultValue: [value, defaultValue],
      disabled: disabled,
      marks: disperseValue,
      style: style
    }, otherProps));
  };
  return function () {
    switch (type) {
      case "单滑块":
        return dan();
        break;
      case "双滑块":
        return shuang();
        break;
      default:
        return null;
    }
  }();
  // return (
  //   type === '单滑块' ? (disperse === '无' ? <Range value={value} disabled={disabled} style={style} {...otherProps} /> : <Range value={value} disabled={disabled} marks={disperseValue} style={style} {...otherProps} />) :
  //     (disperse === '无' ? <Range fixedWidth value={[value, defaultValue]} defaultValue={[value, defaultValue]} style={style} {...otherProps} /> : <Range fixedWidth value={[value, defaultValue]} defaultValue={[value, defaultValue]} disabled={disabled} marks={disperseValue} style={style} {...otherProps} />)
  // )
};

mySlider.displayName = 'mySlider';
export default mySlider;