import React from 'react' import { translate } from 'react-i18next' import PropTypes from 'prop-types' import classnames from 'classnames' import FileItem from './FileItem.jsx' // @TODO set Folder as a component, state open will come from parent container (which will come from redux) // update: or not ? class Folder extends React.Component { constructor (props) { super(props) this.state = { open: false } } handleClickToggleFolder = () => { !this.state.open && this.props.folderData.content.length === 0 && this.props.onClickFolder(this.props.folderData.id) this.setState({open: !this.state.open}) } handleClickNewFile = e => { e.stopPropagation() // because we have a link inside a link (togler and newFile) console.log('new file') // @TODO } render () { const { app, folderData: { title, content }, onClickItem, onClickFolder, isLast, t } = this.props return (