 module.exports = class AddWorkspaceView extends React.Component
 
   { ESC, ENTER } = KeyboardKeys
+
+  constructor: ->
+
+    super
+
+    @state =
+      inProgress : no
 
 
   getDataBindings: ->

    { value } = event.target

    return  unless value.trim()

    options =
      name          : value
      machineUId    : @props.machine.get 'uid'
      machineLabel  : @props.machine.get 'label'

    IDEHelpers.createWorkspace options


  onClick: (event) ->

    kd.utils.stopDOMEvent event


  # This method is a workaround.
  # Refactor this method when "IDEHelpers.createWorkspace" is refactored.
  # Listen result of "IDEHelpers.createWorkspace"
  emit: (eventType, error) ->

    @setState { inProgress : no }


  render: ->
