1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/components/table_header.js

36 lines
1.0 KiB
JavaScript
Raw Normal View History

2015-05-20 14:48:57 +02:00
import React from 'react';
import TableColumnMixin from '../mixins/table_column_mixin';
import GeneralUtils from '../utils/general_utils';
let TableHeader = React.createClass({
mixins: [TableColumnMixin],
propTypes: {
columnMap: React.PropTypes.object.isRequired
},
render() {
let columnMapValuesList = GeneralUtils.valuesOfObject(this.props.columnMap);
return (
<div className="col-xs-12 col-sm-12 col-md-12 col-lg-12">
<div className="row">
{columnMapValuesList.map((val, i) => {
let columnClass = this.calcColumnClasses(this.props.columnMap, i);
2015-05-20 14:48:57 +02:00
return (
<div className={columnClass + ' ascribe-table-header-column'} key={i}>
{val.displayName}
2015-05-20 14:48:57 +02:00
</div>
);
})}
</div>
</div>
);
}
});
export default TableHeader;