 
 ReactDOMServer = require('react-dom/server')
 
-{Col, Row, Button, ButtonGroup, ButtonToolbar, Input, Panel, Well, SplitButton, MenuItem} = require('react-bootstrap')
+{Col, Row, Button, ButtonGroup, ButtonToolbar, Input, Panel, Well, SplitButton, MenuItem, Alert} = require('react-bootstrap')
 {ErrorDisplay, Icon, Loading, TimeAgo, Tip, ImmutablePureRenderMixin, Space} = require('./r_misc')
 {User} = require('./users')
 {salvus_client} = require('./salvus_client')

        e.preventDefault()
        if @state.filename[@state.filename.length - 1] == '/'
            @create_folder()
        else
            @create_file()

    render_header: ->

            on_error     : on_error
            switch_over  : true

    keydown : (e) ->
        if e.keyCode==13 and @refs.project_new_filename.getValue().split(".").length < 2
            @setState(warning : true)
            ReactDOM.findDOMNode(@refs.project_new_filename.refs.input).disabled = true

    accept_file : ->
        @create_file()

    decline_file : ->
        @setState(warning : false)
        ReactDOM.findDOMNode(@refs.project_new_filename.refs.input).disabled = false

    render_alert : ->
        <Alert bsStyle='warning' style={marginTop: '10px', fontWeight : 'bold'}>
            <p>Warning: You tried to create a file with no extensions. Are you sure you want to create a file with no extensions?</p>
            <Button onClick={@accept_file} style={marginRight:'5px'}>
                Yes
            </Button>
            <Button onClick={@decline_file} style={marginRight:'5px'}>
                No
            </Button>
        </Alert>


    render : ->
        <div>
            {@render_header()}
