                 {text}
             </Alert>
 
-    render_create_file_warning : ->
-        if @props.create_file_alert
-            <Alert style={wordWrap:'break-word'} bsStyle='warning'>
-                You must enter file name above to create it
+    render_file_creation_error : ->
+        if @props.file_creation_error
+            <Alert style={wordWrap:'break-word'} bsStyle='warning' onDismiss=@dismiss_alert>
+                {@props.file_creation_error}
             </Alert>
+
+    dismiss_alert : ->
+        @props.actions.setState(file_creation_error : '')
 
     search_submit: ->
         # TODO: Add visual indication that a file is selected at all.


    # Go to new file tab if no file is specified
    handle_file_click : ->
        if @props.file_search.length == 0
            @props.actions.set_focused_page('project-new-file')
        else if @props.file_search?[@props.file_search.length - 1] == '/'
            @props.create_folder()

    displayName : 'ProjectFiles-ProjectFilesSearch'

    propTypes :
        file_search        : rtypes.string
        current_path       : rtypes.string
        actions            : rtypes.object.isRequired
        create_file        : rtypes.func.isRequired
        create_folder      : rtypes.func.isRequired
        selected_file      : rtypes.object   # if given, file selected by cursor, which we open on pressing enter
        file_creation_error: rtypes.string
        files_displayed    : rtypes.bool # True if there are any files displayed

    getDefaultProps : ->
        file_search : ''
