"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = TutorialStepNav;

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _Button = _interopRequireDefault(require("../../../../components/Button"));

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

// 3rd-party libs
// Components
// Permissions
// Style
var classes = {};
/* istanbul ignore next */

if (typeof window !== 'undefined') classes = require("./style.module.scss");

function TutorialStepNav(props) {
  var children = props.children,
      createStep = props.createStep;
  return /*#__PURE__*/_react["default"].createElement(_.PermissionContext.Consumer, null, function (readOnly) {
    return /*#__PURE__*/_react["default"].createElement("div", {
      className: classes.TutorialStepNav
    }, children, !readOnly && /*#__PURE__*/_react["default"].createElement(_Button["default"], {
      className: classes['TutorialStepNav-Button'],
      onClick: createStep
    }, /*#__PURE__*/_react["default"].createElement("i", {
      className: "fa fa-plus"
    }), /*#__PURE__*/_react["default"].createElement("span", null, "Add Step")));
  });
}

TutorialStepNav.propTypes = {
  children: _propTypes["default"].oneOfType([_propTypes["default"].arrayOf(_propTypes["default"].node), _propTypes["default"].node]),
  createStep: _propTypes["default"].func
};
TutorialStepNav.defaultProps = {
  children: ''
};