1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-18 15:08:22 +00:00
seahub/frontend/src/components/draft-list-view/draft-list-view.js

49 lines
1.3 KiB
JavaScript
Raw Normal View History

2018-09-15 08:14:17 +00:00
import React from 'react';
import PropTypes from 'prop-types';
import { gettext } from '../constants';
import DraftListItem from './draft-list-item';
2018-09-15 08:14:17 +00:00
const propTypes = {
isItemFreezed: PropTypes.bool.isRequired,
draftList: PropTypes.array.isRequired,
onMenuToggleClick: PropTypes.func.isRequired,
};
class DraftListView extends React.Component {
2018-09-15 08:14:17 +00:00
render() {
let drafts = this.props.draftList;
return (
2018-09-21 06:16:15 +00:00
<div className="table-container">
<table>
<thead>
<tr>
<th style={{width: '4%'}}>{/*img*/}</th>
<th style={{width: '46%'}}>{gettext('Name')}</th>
<th style={{width: '20%'}}>{gettext('Owner')}</th>
<th style={{width: '20%'}}>{gettext('Last Update')}</th>
2018-09-21 06:16:15 +00:00
<th style={{width: '10%'}}></th>
</tr>
</thead>
<tbody>
{ drafts && drafts.map((draft) => {
return (
<DraftListItem
2018-09-21 06:16:15 +00:00
key={draft.id}
draft={draft}
onMenuToggleClick={this.props.onMenuToggleClick}
isItemFreezed={this.props.isItemFreezed}
/>
);
})}
</tbody>
</table>
</div>
2018-09-15 08:14:17 +00:00
);
}
}
DraftListView.propTypes = propTypes;
2018-09-15 08:14:17 +00:00
export default DraftListView;