 
   render: ->
     <div>
-      <p>This project doesn’t have a tutorial yet.</p>
+      <p>This project doesn’t have a tutorial.</p>
       {if @state.error?
           <p>{@state.error.toString()}</p>}
       <p>

      loading: true
      error: null
      tutorial: null
    apiClient.type('tutorials').get project_id: @props.project?.id
      .then ([tutorial]) =>
        @setState {tutorial}
      .catch (error) =>
        @setState {error}
      .then =>
        @setState loading: false

  render: ->
    if @state.loading

      <p>{@state.error.toString()}</p>
    else if @state.tutorial?
      window?.editingTutorial = @state.tutorial
      <TutorialEditorController
        project={@props.project}
        tutorial={@state.tutorial}
        media={@state.media}
        onDelete={@handleTutorialCreateOrDelete}
      />
    else
      <TutorialCreator project={@props.project} onCreate={@handleTutorialCreateOrDelete} />

  handleTutorialCreateOrDelete: ->
    @fetchTutorialFor @props.project

module.exports = TutorialEditorFetcher
