// 3rd-party libs
import React from 'react';
import PropTypes from 'prop-types';

// Components
import Button from '../../../../components/Button';

// Internals
import classes from './style.module.scss';

// Permissions
import { PermissionContext } from '../..';

export default function TutorialStepNav(props) {
  var children = props.children,
      createStep = props.createStep;

  return React.createElement(
    PermissionContext.Consumer,
    null,
    function (readOnly) {
      return React.createElement(
        'div',
        { className: classes.TutorialStepNav },
        children,
        !readOnly && React.createElement(
          Button,
          { className: classes['TutorialStepNav-Button'], onClick: createStep },
          React.createElement('i', { className: 'fa fa-plus' }),
          React.createElement(
            'span',
            null,
            'Add Step'
          )
        )
      );
    }
  );
}
TutorialStepNav.propTypes = process.env.NODE_ENV !== "production" ? {
  children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]),
  createStep: PropTypes.func
} : {};

TutorialStepNav.defaultProps = {
  children: ''
};