1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00
onion/js/components/table.js
Tim Daubenschütz 14728af9f1 fix step 1
2015-05-21 14:03:56 +02:00

33 lines
978 B
JavaScript

import React from 'react';
import TableItem from './table_item';
import TableHeader from './table_header';
let Table = React.createClass({
propTypes: {
columnMap: React.PropTypes.object.isRequired
},
render() {
if(this.props.itemList && this.props.itemList.length > 0) {
return (
<div className="ascribe-table">
<TableHeader columnMap={this.props.columnMap} itemList={this.props.itemList} fetchList={this.props.fetchList} orderAsc={this.props.orderAsc} orderBy={this.props.orderBy} />
{this.props.itemList.map((item, i) => {
return (
<TableItem columnMap={this.props.columnMap} columnContent={item} key={i} />
);
})}
</div>
);
} else {
return (
<p>Loading</p>
);
}
}
});
export default Table;