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

43 lines
1.1 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-09-21 06:16:15 +00:00
<div className="table-container">
<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>
2018-09-21 06:16:15 +00:00
</thead>
<tbody>
{children && children.map((node, index) => {
return (
<TreeDirList key={index} node={node} onMainNodeClick={this.props.onMainNodeClick}/>
);
2018-09-21 06:16:15 +00:00
})}
</tbody>
</table>
</div>
);
2018-09-04 09:16:50 +00:00
}
}
TreeDirView.propTypes = propTypes;
2018-09-04 09:16:50 +00:00
export default TreeDirView;