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

47 lines
1.2 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';
2018-09-15 08:14:17 +00:00
import ListItem from './list-item';
const propTypes = {
isItemFreezed: PropTypes.bool.isRequired,
draftList: PropTypes.array.isRequired,
onMenuToggleClick: PropTypes.func.isRequired,
};
class ListView extends React.Component {
render() {
let drafts = this.props.draftList;
return (
<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('Update time')}</th>
<th style={{width: '10%'}}></th>
</tr>
</thead>
<tbody>
{ drafts && drafts.map((draft) => {
return (
<ListItem
key={draft.id}
draft={draft}
onMenuToggleClick={this.props.onMenuToggleClick}
isItemFreezed={this.props.isItemFreezed}
/>
);
})}
</tbody>
</table>
);
}
}
ListView.propTypes = propTypes;
export default ListView;