mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
33 lines
978 B
JavaScript
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;
|