import React from 'react'; import PropTypes from 'prop-types'; import { siteRoot } from '../../utils/constants'; const propTypes = { node: PropTypes.object.isRequired, onMainNodeClick: PropTypes.func.isRequired, }; class TreeDirList extends React.Component { constructor(props) { super(props); this.state = { highlight: false, isOperationShow: false, }; } onMouseEnter = () => { this.setState({highlight: true}); } onMouseLeave = () => { this.setState({highlight: false}); } onMainNodeClick = () => { this.props.onMainNodeClick(this.props.node); } render() { let node = this.props.node; return ( icon {node.name} {node.size} {node.last_update_time} ); } } TreeDirList.propTypes = propTypes; export default TreeDirList;