       onNextStep: ->
         channel.emit("leave.#{step.id}")
 
+      waitingText: (isWaiting and ' Saving…') or ''
+
     if taskId?
       wrapperProps =
         'data-step-number': tasks.getStepIndex(taskId, step.id) + 1

{Reactive} = require '../reactive'
apiChannelName = 'exercise'

ExerciseBase = React.createClass
  displayName: 'ExerciseBase'
  getInitialState: ->


  getStepState: (props) ->
    props ?= @props
    {item, status} = props

    isWaiting = _.contains(WAIT_STATES, status)

    step: _.last(item)
    parts: item
    isWaiting: isWaiting

  componentWillReceiveProps: (nextProps) ->
    console.info(nextProps)
    nextState = @getStepState(nextProps)

    @setState(nextState)
