'use strict'; import React from 'react'; import TableHeader from './table_header'; import { ColumnModel } from './models/table_models'; let Table = React.createClass({ propTypes: { columnList: React.PropTypes.arrayOf(React.PropTypes.instanceOf(ColumnModel)), changeOrder: React.PropTypes.func, orderBy: React.PropTypes.string, orderAsc: React.PropTypes.bool, className: React.PropTypes.string, children: React.PropTypes.array, itemList: React.PropTypes.array }, renderChildren() { return React.Children.map(this.props.children, (child, i) => { return React.cloneElement(child, { columnList: this.props.columnList, columnContent: this.props.itemList[i], key: i }); }); }, render() { return (