'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);

var _reactTabs = require('react-tabs');

require('react-tabs/style/react-tabs.css');

var _Editor = require('../Editor/Editor');

var _Editor2 = _interopRequireDefault(_Editor);

var _InstructionsEditor = require('../InstructionsEditor/InstructionsEditor');

var _InstructionsEditor2 = _interopRequireDefault(_InstructionsEditor);

var _TestSpecEditor = require('../TestSpecEditor/TestSpecEditor');

var _TestSpecEditor2 = _interopRequireDefault(_TestSpecEditor);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var EditModeTabs = function EditModeTabs(_ref) {
  var initialCode = _ref.initialCode,
      showLints = _ref.showLints,
      instructions = _ref.instructions,
      testSpec = _ref.testSpec,
      handleInstructionsChange = _ref.handleInstructionsChange,
      handleTestSpecChange = _ref.handleTestSpecChange,
      handleBoilerplateChange = _ref.handleBoilerplateChange,
      handleLintedBoilerplateCode = _ref.handleLintedBoilerplateCode,
      handleReset = _ref.handleReset;
  return _react2.default.createElement(
    _reactTabs.Tabs,
    null,
    _react2.default.createElement(
      _reactTabs.TabList,
      { className: 'editor-selection-panels' },
      _react2.default.createElement(
        _reactTabs.Tab,
        { className: 'selection-panel' },
        'Boilerplate'
      ),
      _react2.default.createElement(
        _reactTabs.Tab,
        { className: 'selection-panel' },
        'Instructions'
      ),
      _react2.default.createElement(
        _reactTabs.Tab,
        { className: 'selection-panel' },
        'Tests'
      )
    ),
    _react2.default.createElement(
      _reactTabs.TabPanel,
      null,
      _react2.default.createElement(_Editor2.default, {
        code: initialCode,
        showLints: showLints,
        onAnyCode: handleBoilerplateChange,
        onValidCode: handleLintedBoilerplateCode,
        handleReset: handleReset
      })
    ),
    _react2.default.createElement(
      _reactTabs.TabPanel,
      null,
      _react2.default.createElement(_InstructionsEditor2.default, { code: instructions, onAnyCode: handleInstructionsChange })
    ),
    _react2.default.createElement(
      _reactTabs.TabPanel,
      null,
      _react2.default.createElement(_TestSpecEditor2.default, { code: testSpec, onAnyCode: handleTestSpecChange })
    )
  );
};

EditModeTabs.propTypes = {
  initialCode: _propTypes2.default.string,
  showLints: _propTypes2.default.bool,
  instructions: _propTypes2.default.string,
  testSpec: _propTypes2.default.string,
  handleInstructionsChange: _propTypes2.default.func,
  handleTestSpecChange: _propTypes2.default.func,
  handleBoilerplateChange: _propTypes2.default.func,
  handleLintedBoilerplateCode: _propTypes2.default.func,
  handleReset: _propTypes2.default.func
};

exports.default = EditModeTabs;