         file_search : ''
 
     render_help_info : ->
-        if @props.file_search?.length > 0 and @props.files_displayed
+        if @props.file_search.length > 0 and @props.files_displayed
             firstFolderPosition = @props.file_search.indexOf('/')
             if @props.file_search == '/'
                 text = "Showing all folders in this directory"


    displayName : 'ProjectFiles-NoFiles'

    # Go to the new file tab if there is no file search
    handle_click : ->
        if not @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()
        else
            @props.create_file()

    # Returns the full file_search text in addition to the default extension if applicable
    full_path_text : ->
        if @props.file_search?.lastIndexOf('.') <= @props.file_search?.lastIndexOf('/')
          ext = "sagews"
        if ext and @props.file_search.slice(-1) isnt '/'
            "#{@props.file_search}.#{ext}"


    # TODO: Make better help text
    render_help_alert : ->
        last_folder_index = @props.file_search.lastIndexOf('/')
        if @props.file_search.indexOf('\\') != -1
            <Alert style={marginTop: '10px', fontWeight : 'bold'} bsStyle='danger'>
                Warning: \ is an illegal character
            </Alert>
        # Non-empty search and there is a file divisor ('/')
        else if @props.file_search.length > 0 and last_folder_index > 0
            <Alert style={marginTop: '10px'} bsStyle='info'>
                {@render_help_text(last_folder_index)}
            </Alert>
