'use strict';

exports.__esModule = true;
exports.default = TutorialStepNav;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

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

var _propTypes2 = _interopRequireDefault(_propTypes);

var _Button = require('../../../../components/Button');

var _Button2 = _interopRequireDefault(_Button);

var _styleModule = require('./style.module.scss');

var _styleModule2 = _interopRequireDefault(_styleModule);

var _ = require('../..');

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

// Internals
function TutorialStepNav(props) {
  var children = props.children,
      createStep = props.createStep;

  return _react2.default.createElement(
    _.PermissionContext.Consumer,
    null,
    function (readOnly) {
      return _react2.default.createElement(
        'div',
        { className: _styleModule2.default.TutorialStepNav },
        children,
        !readOnly && _react2.default.createElement(
          _Button2.default,
          { className: _styleModule2.default['TutorialStepNav-Button'], onClick: createStep },
          _react2.default.createElement('i', { className: 'fa fa-plus' }),
          _react2.default.createElement(
            'span',
            null,
            'Add Step'
          )
        )
      );
    }
  );
}

// Permissions


// Components
// 3rd-party libs

TutorialStepNav.propTypes = process.env.NODE_ENV !== "production" ? {
  children: _propTypes2.default.oneOfType([_propTypes2.default.arrayOf(_propTypes2.default.node), _propTypes2.default.node]),
  createStep: _propTypes2.default.func
} : {};

TutorialStepNav.defaultProps = {
  children: ''
};
module.exports = exports['default'];