import _extends from "@babel/runtime/helpers/esm/extends";
import _inheritsLoose from "@babel/runtime/helpers/esm/inheritsLoose";
import React from 'react';
import { Switcher } from "../../../components/Switcher";
var defaultItems = ['Default', 'Error'];
export var SwitcherPlayground = /*#__PURE__*/function (_React$Component) {
  function SwitcherPlayground() {
    var _this;
    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }
    _this = _React$Component.call.apply(_React$Component, [this].concat(args)) || this;
    _this.state = {
      value: '',
      error: false
    };
    _this.handleValueChange = function (value) {
      _this.setState({
        value: value,
        error: value === 'Error'
      });
    };
    return _this;
  }
  _inheritsLoose(SwitcherPlayground, _React$Component);
  var _proto = SwitcherPlayground.prototype;
  _proto.render = function render() {
    return /*#__PURE__*/React.createElement(Switcher, _extends({
      value: this.state.value,
      onValueChange: this.handleValueChange,
      items: this.props.items || defaultItems,
      error: this.state.error
    }, this.props));
  };
  return SwitcherPlayground;
}(React.Component);