import { h, Component } from 'preact'

export default function NewFolderView (props) {
  if (! props.visible) {
    return null
  }
  return (
    <div class='window'>
      <div class='heading'>
        <b>new folder</b>
        <div class='buttons'>
          <button onClick={props.onClose}>x</button>
        </div>
      </div>
      <input type='text'
        autofocus
        placeholder='Enter a name'
        value={props.name}
        onChange={props.onChange}
      />
    </div>
  )
}
