function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
import classnames from 'classnames';
import React from 'react';
import styles from "./index.module.less";
import { AIMode, AIModeMeta } from "../../constant";
import { FormattedMessage } from 'dumi';
export var ModeSelector = function ModeSelector(_ref) {
  var value = _ref.value,
    size = _ref.size,
    onChange = _ref.onChange;
  return /*#__PURE__*/React.createElement("div", {
    className: classnames(styles.datasetSelector, _defineProperty({}, styles.compact, size === 'compact'))
  }, /*#__PURE__*/React.createElement("div", {
    className: styles.typeSwitcher
  }, [AIMode.implement, AIMode.solve].map(function (mode) {
    var meta = AIModeMeta[mode];
    return /*#__PURE__*/React.createElement("div", {
      key: mode,
      className: classnames(styles.switchBtn, _defineProperty({}, styles.active, mode === value)),
      onClick: function onClick() {
        if (mode !== value) {
          onChange(mode);
        }
      }
    }, meta.icon, /*#__PURE__*/React.createElement(FormattedMessage, {
      id: meta.name
    }));
  })));
};