2018-09-29 10:32:53 +00:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2018-10-25 05:36:06 +00:00
|
|
|
import { gettext } from '../../utils/constants';
|
2019-01-28 08:48:03 +00:00
|
|
|
import WikiDirListItem from './wiki-dir-list-item';
|
2018-09-29 10:32:53 +00:00
|
|
|
|
|
|
|
const propTypes = {
|
2019-01-28 08:48:03 +00:00
|
|
|
path: PropTypes.string.isRequired,
|
|
|
|
direntList: PropTypes.array.isRequired,
|
|
|
|
onDirentClick: PropTypes.func.isRequired,
|
2018-10-16 10:19:51 +00:00
|
|
|
};
|
2018-09-04 09:16:50 +00:00
|
|
|
|
2019-01-28 08:48:03 +00:00
|
|
|
class WikiDirListView extends React.Component {
|
2018-09-29 07:47:53 +00:00
|
|
|
|
2018-09-04 09:16:50 +00:00
|
|
|
render() {
|
|
|
|
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>
|
2019-01-28 08:48:03 +00:00
|
|
|
{this.props.direntList.length !== 0 && this.props.direntList.map((dirent, index) => {
|
2018-11-22 03:05:47 +00:00
|
|
|
return (
|
2019-01-28 08:48:03 +00:00
|
|
|
<WikiDirListItem key={index} path={this.props.path} dirent={dirent} onDirentClick={this.props.onDirentClick}/>
|
2018-11-22 03:05:47 +00:00
|
|
|
);
|
|
|
|
})}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2018-09-29 10:32:53 +00:00
|
|
|
);
|
2018-09-04 09:16:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-28 08:48:03 +00:00
|
|
|
WikiDirListView.propTypes = propTypes;
|
2018-09-29 10:32:53 +00:00
|
|
|
|
2019-01-28 08:48:03 +00:00
|
|
|
export default WikiDirListView;
|