1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-25 04:03:19 +00:00
seahub/frontend/src/components/tree-dir-view/tree-dir-view.js

41 lines
1.0 KiB
JavaScript
Raw Normal View History

import React from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../../utils/constants';
import TreeDirList from './tree-dir-list';
const propTypes = {
node: PropTypes.object.isRequired,
onMainNodeClick: PropTypes.func.isRequired,
2018-10-16 10:19:51 +00:00
};
2018-09-04 09:16:50 +00:00
class TreeDirView extends React.Component {
2018-09-29 07:47:53 +00:00
2018-09-04 09:16:50 +00:00
render() {
let node = this.props.node;
let children = node.hasChildren() ? node.children : null;
return (
2018-11-22 03:05:47 +00:00
<table>
<thead>
<tr>
<th style={{width: '4%'}}></th>
<th style={{width: '66%'}}>{gettext('Name')}</th>
<th style={{width: '15%'}}>{gettext('Size')}</th>
<th style={{width: '15%'}}>{gettext('Last Update')}</th>
</tr>
</thead>
<tbody>
{children && children.map((node, index) => {
return (
<TreeDirList key={index} node={node} onMainNodeClick={this.props.onMainNodeClick}/>
);
})}
</tbody>
</table>
);
2018-09-04 09:16:50 +00:00
}
}
TreeDirView.propTypes = propTypes;
2018-09-04 09:16:50 +00:00
export default TreeDirView;